Using snackbar while bottom sheet is open
rezafaraji93 opened this issue · comments
rezafaraji93 commented
When the bottom sheet is open and the background is dimmed, and when we want to show an snackbar while bottom sheet is expanded, the snackbar places on the dimmed part of the screen and can not be recognized. Also, when the bottom sheet has filled the screen height, user can not see the snackbar. Any solutions for this?
dokar3 commented
Since the sheet is in another window instead of the activity window, there is no good approach to achieve this. But if your snack bar is at the bottom of the screen, you can simply display another snack bar within the sheet.
BottomSheet(...) {
Box {
SheetContent(state)
SnackbarHost(
hostState = snackbarHostState, // The same state used on the main content
modifier = Modifier.align(Alignment.BottomCenter),
)
}
}