Is there a way to make a Material3 ModalBottomSheet not dismissible? Like the old View/XML based ModalBottomSheets?
s
Stylianos Gakis
07/20/2023, 8:50 PM
I think “modal” implies that it’s dismissible no?
Maybe you’re looking for BottomSheetScaffold?
j
jordond
07/20/2023, 8:56 PM
In the View land
BottomSheetDialogFragment()
had a
isCancelable
property you could set. I’m basically looking for the equivalent.
s
Stylianos Gakis
07/20/2023, 8:58 PM
Yeah, that one did not say “modal” then. Did you check out the link I sent you?
j
jordond
07/20/2023, 8:59 PM
Yeah, unfortunately I’m using Voyager for Navigation, and it’s
BottomSheetNavigator
uses a
ModalBottomSheetLayout()
. I guess I’ll have to look for an alternative, thanks 👍
s
Stylianos Gakis
07/20/2023, 9:07 PM
If you want the sheet to stay there permanently, it sounds like it shouldn’t be a navigation destination really, but more like part of the screen in which you are currently in, potentially using this Scaffold as the way to bring it in.
But of course I may be missing part of your requirements which makes what I am saying not true
a
Abhimanyu
07/21/2023, 11:13 AM
You can use
confirmValueChange
to specify logic on when to hide the bottom sheet.