Is there a good way yet to use ModalBottomSheet wi...
# compose-android
b
Is there a good way yet to use ModalBottomSheet with nested navigation inside of it and having the backButton navigate back rather than closing the sheet? I asked this a couple years ago and didn't really find a good solution. You can set
Copy code
properties = ModalBottomSheetProperties(
                shouldDismissOnBackPress = true
            )
but that just makes the back button do nothing, can't use backHandlers or anything. I also still want the swipe to dismiss to fully dismiss so I'm not sure if there's a combo of messing with confirmValueChange + onDismissRequest that works for this situation.
i
b
Wait.. I just moved the backHandler inside the ModalBottomSheet content and it's being called even with shouldDismissOnBackPress = false..
c
I don't know if this solves your issue but you could try with compose unstyled. https://composables.com/compose-unstyled I've been using their bottom sheet primitive with cmp and I have gained my sanity back. typically @Alex Styl is quick to implement feedback
b
Copy code
implementation("androidx.navigation3:navigation3-runtime:1.0.0-rc01")
implementation("androidx.navigation3:navigation3-ui:1.0.0-rc01")
implementation("androidx.compose.material3:material3:1.4.0")
implementation("androidx.compose.material3:material3-window-size-class:1.4.0")
I'll check it out Colton. I was thinking I was going to have to implement my own "Sheet" with a Dialog.. But seemingly it's working now that I've moved the backHandler inside the sheet.