Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with snackbar location #1

Open
Maxxan opened this issue Apr 30, 2023 · 0 comments
Open

Problem with snackbar location #1

Maxxan opened this issue Apr 30, 2023 · 0 comments

Comments

@Maxxan
Copy link

Maxxan commented Apr 30, 2023

Thanks for a very good component!

I tried the M3 version, and unfortunately there is a problem with snackbars. The are shown above all the (invisible) sub FABs (in the middle of the screen, vertically) instead of above the navigation bar as it should.

Any idea how to fix this?

Here is some code to reproduce the problem:

val snackbarHostState = remember { SnackbarHostState() }
val snackbarCoroutineScope = rememberCoroutineScope()
val fabState = rememberSpeedDialFloatingActionButtonState()
Scaffold(
    bottomBar = {
        BottomAppBar(
            actions = {},
            floatingActionButton = {
                BottomAppBarSpeedDialFloatingActionButton(
                    state = fabState
                ) {
                    Icon(Icons.Default.Add, contentDescription = null)
                }
            }
        )
    },
    floatingActionButton = {
        SubSpeedDialFloatingActionButtons(
            state = fabState,
            items = listOf(
                FloatingActionButtonItem(
                    icon = Icons.Default.Person,
                    label = "Person"
                ) {},
                FloatingActionButtonItem(
                    icon = Icons.Default.Home,
                    label = "Home"
                ) {}
            )
        )
    },
    snackbarHost = { SnackbarHost(snackbarHostState) },
) {
        Button(onClick = { snackbarCoroutineScope.launch {  snackbarHostState.showSnackbar("Snackbar") } }) {
            Text("Show snackbar")
        }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant