I have a BottomSheetScaffold and I want to control...
# compose
d
I have a BottomSheetScaffold and I want to control its state externally. I do
confirmStateChange = { notifyStateChangeRequest(it); false }
where
notifyStateChangeRequest()
will decide what state to switch to and cause
LaunchedEffect(newSheetState) { scaffoldState.bottomSheetState.animateTo(newSheetState) }
. The problem is that
confirmStateChange { false }
causes
Swipeable
to start its own "rollback to previous state" animation which conflicts with mine and produces a visible jitter. Is there a way around this?
v
Sounds like a bug to me, I’d file an issue
Btw I have similar approach for DrawerState and BackdropState (as we discussed earlier) and this I didn’t notice, so maybe that’s specific to bottom sheet only
d
I started noticing this on beta09 (after I upgraded today), but not sure maybe I just didn't notice earlier. Will investigate a bit more.