Calle Höglund
09/22/2025, 9:12 AMtoast on top of a modalBottomSheet. I've tried messing with z-indexes without any success. Im using Scaffold to display the toasts thru the snackbarhost.
Both the Scaffold and the ModalBottomSheet are from material3.
Has anyone stumbled upon a similar problem? Any suggestions or solutions?Tgo1014
09/22/2025, 9:37 AMErnestas
09/22/2025, 10:47 AM# Usage:
ModalBottomSheet(
<...>
snackbarHostState = snackbarHostState,
) {...}
# ModalBottomSheet.kt
@Composable
fun ModalBottomSheet(
snackbarHostState: SnackbarHostState = rememberSnackbarHostState(),
content: @Composable ColumnScope.() -> Unit,
<...>
) {
MaterialModalBottomSheet(
<...>
) {
Box {
Column(modifier = Modifier.padding(contentPadding)) {
content()
Spacer(Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
}
SnackbarHost(
snackbarHostState = snackbarHostState,
modifier =
Modifier
.align(Alignment.BottomCenter)
.navigationBarsPadding()
.padding(...),
) { snackbarVisuals ->
Snackbar(snackbarVisuals)
}
}
}
}
}Calle Höglund
09/22/2025, 11:14 AMCalle Höglund
09/22/2025, 11:18 AMErnestas
09/22/2025, 11:33 AMCalle Höglund
09/22/2025, 11:48 AMCalle Höglund
09/22/2025, 2:46 PMpointerInput hack)