dokar3 / sheets

Another feature-rich bottom sheet for Compose Multiplatform.

Home Page:https://dokar3.github.io/sheets/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using snackbar while bottom sheet is open

rezafaraji93 opened this issue · comments

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?

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),
        )
    }
}