I have an issue where the Bottom Sheet opens on ro...
# compose
a
I have an issue where the Bottom Sheet opens on rotation. I am using
BottomSheetScaffold
with Compose version 1.4.3 and Material. My state
Copy code
val scaffoldState = rememberBottomSheetScaffoldState(
    drawerState = rememberDrawerState(
      initialValue = DrawerValue.Closed,
      confirmStateChange = { drawerValue ->
        val sliderState = when (drawerValue) {
          DrawerValue.Closed -> SliderState.Closed
          DrawerValue.Open -> SliderState.Opened
        }
        eventsHandler.onSettingsSliderStateChanged(sliderState)
        true
      },
    ),
    bottomSheetState = rememberBottomSheetState(
      initialValue = BottomSheetValue.Collapsed,
      confirmStateChange = { bottomValue ->
        val sliderState = when (bottomValue) {
          BottomSheetValue.Collapsed -> SliderState.Closed
          BottomSheetValue.Expanded -> SliderState.Opened
        }
        eventsHandler.onEpisodesSliderStateChanged(sliderState)
        true
      }
    )
  )
Copy code
BottomSheetScaffold(
  scaffoldState = scaffoldState,
  drawerContent = {
    drawer
  },
  drawerShape = with(LocalDensity.current) {
    CustomShape(Dimens.PlayerSettingsDrawerWidth.dp.toPx())
  },
  drawerScrimColor = AlmanasaColors.Transparent,
  sheetContent = {
    BottomSheet
  },
  sheetPeekHeight = 0.dp,
) {
  content
}
Is the issue related to the state? Because when the rotation changes, the state changes automatically. Why does this value change?
👀