Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation buttons on top of ModalBottomSheet

I use androidx.compose.material3:material3:1.2.0-beta02 for ModalBottomSheet. But on some devices with navigation buttons i have an issue:

    ModalBottomSheet(
        onDismissRequest = { onDismiss() },
        windowInsets = WindowInsets.Companion.navigationBars
    ) {
        Column {
            itemList.forEachIndexed { index, item ->
            ...
            }
        }
    }

enter image description here

I try to find some solutions like this - How to prevent ModalBottomSheet from overlapping with the system buttons?. Yes, indeed, from a certain version we can set up windowInsets for ModalBottomSheet. By default: windowInsets: WindowInsets = BottomSheetDefaults.windowInsets,

But neither the default nor the others I tried (windowInsets = WindowInsets.Companion.navigationBars, windowInsets = WindowInsets.Companion.ime) solved my problem. Are there any other options to prevent the buttons from overlapping my ModalBottomSheet?

like image 342
Sunbey13 Avatar asked Oct 16 '25 20:10

Sunbey13


1 Answers

Upgrading to material3 version 1.3.0-beta01 resolved this issue for me

androidx.compose.material3:material3:1.3.0-beta01
like image 76
EMallon Avatar answered Oct 19 '25 11:10

EMallon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!