Hi is there a way to control to disable dismiss of...
# compose
c
Hi is there a way to control to disable dismiss of
ModalBottomSheetLayout
when the unfocused/background region is pressed?
r
Looks like this is part of the core functionality of
ModalBottomSheetLayout
if you check its source:
Copy code
Box(Modifier.fillMaxSize()) {
            content()
            Scrim(
                color = scrimColor,
                onDismiss = {
                    if (sheetState.confirmStateChange(Hidden)) {
                        scope.launch { sheetState.hide() }
                    }
                },
                visible = sheetState.targetValue != Hidden
            )
        }
Note the
onDismiss
c
thanks @rattleshirt, I figured out this can be done
Copy code
var isAutoDismissible = remember { false }
val state = rememberModalBottomSheetState(
            ModalBottomSheetValue.Hidden,
            confirmStateChange ={isAutoDismissible }
        )
👍 1