Is there a way for a `ModalBottomSheet` not be dis...
# compose-android
t
Is there a way for a
ModalBottomSheet
not be dismissed when clicking the scrim?
p
not happy about it, but this works for me
Copy code
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun StubbornModalBottomSheet(content: @Composable ColumnScope.() -> Unit) {
    ModalBottomSheet(
        onDismissRequest = { /* never called, we forbid Hidden value below */ },
        sheetState = rememberModalBottomSheetState(
            skipPartiallyExpanded = true,
            confirmValueChange = {
                // let's ignore all changes requested by dragging
                it == SheetValue.Expanded
            },
        ),
        dragHandle = null,
        properties = ModalBottomSheetProperties(
            shouldDismissOnBackPress = false,
        ),
        content = content,
    )
}
oh sorry, you meant
ModalBottomSheetLayout
not
ModalBottomSheet
🙃
t
ahh no
I wrote it wrong
I meant the bottom sheet hahah
This should work! I totally forgot about the confirmValueChange
👍 1
I’ll try this approach, thanks a lot!
🫶 1