https://kotlinlang.org logo
#compose
Title
# compose
d

divid3d

06/14/2021, 12:30 PM
Hi. Is there any possibility to disable dragging in
ModalBottomSheetLayout
? I'm looking for solution that would allow to hide bottom sheet only programmatically.
d

darkmoon_uk

06/14/2021, 12:50 PM
You should be able to veto any external changes to drawerState by implemeting the
confirmStateChange
function in
drawerState
Default is just
{ true }
to always allow, but you can change to
{ false }
. I'm not sure if programmatic changes are subject to the check...
d

divid3d

06/14/2021, 12:51 PM
That's true, but my goal is to completely disable dragging of bottom sheet.
d

darkmoon_uk

06/14/2021, 12:53 PM
In that case, without knowing specifics, my general approach would be to look for the
onDragging...
handler
Modifier
and registering one further down the hierarchy to swallow the events before they fall down to the Drawer.
...but there might be a better way
Refer to the API - there's a
gesturesEnabled
flag
maybe setting that
false
will do exactly what you want
d

divid3d

06/14/2021, 1:00 PM
It seems you have a good point but I'm looking for solution related to
ModalBottomSheetLayout
instead of
BottomSheetScaffold
c

Ch8n

11/18/2021, 11:53 AM
@divid3d did you find any way disable swipe on
BottomSheetScaffold
?
311 Views