Closed FunkyMuse closed 2 years ago
Temporary fix:
val sheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden, SwipeableDefaults.AnimationSpec)
val bottomSheetNavigator = rememberBottomSheetNavigatorFix(sheetState)
@Composable
fun rememberBottomSheetNavigatorFix(
sheetState: ModalBottomSheetState
): BottomSheetNavigator {
return remember(sheetState) {
BottomSheetNavigator(sheetState = sheetState)
}
}
Whenever you call navigateUp just call sheetState.hide()
too
LaunchedEffect(navController) {
sheetState.hide()
navController.navigateUp()
}
Huh, seems to be fixed with v0.24.1-alpha
I'll investigate more
That would be very surprising but awesome😄 Let us know!
That would be very surprising but awesome😄 Let us know!
This is now a workaround for #978
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
I have the same issue, is there any progress on this issue or should we still use the temporary fix? I'm using v0.27.1
I'm still experiencing this issue today, even with the stable version of Compose. It's frustrating that it hasn't been addressed yet. However, I’ve found a workaround in the meantime. I added a resetState()
function to my ViewModel
, which, as the name suggests, resets all the state within the ViewModel
. I then call this function inside the composable using DisposableEffect
, like this:
DisposableEffect(Unit) {
onDispose { viewModel.resetState() }
}
Description Bottom sheet scrim still visible after using
navigateUp
from BottomSheet destinationSteps to reproduce
also using
https://github.com/google/accompanist/blob/main/sample/src/main/java/com/google/accompanist/sample/navigation/material/BottomSheetNavSample.kt
inside
BottomSheet
function callnavController.navigateUp
Expected behavior The scrim should not be visible once you navigate up
Additional context compose_version = '1.1.0-rc01' accompanist_version = '0.22.0-rc'