Found interesting behaviour of Material3
BottomSheetScaffold
and
NavHost
App is using
NavHost
that has nested navigation inside where few screens will be attached to main
NavHost
, and other smaller one - to
BottomSheetScaffold
NavHost
In first init of the screen bottom sheet can not be hidden on swipe.
Then, if we navigate from nav graph that has bottom sheet to other navigation - on back
BottomSheetScaffold
can be hidden. 😄
Other thing, if we leave screen with
BottomSheetScaffold
expanded - on back we will get :
IllegalStateException - If the offset has not been initialized yet
I am assuming that
NavHost
somehow recreates screen maybe, and
rememberStandardBottomSheetState
initialised again... Still figuring this out, just wanted to share maybe someone already solved similar situation to this and can give some tips where to look