I want to disable back button in the new material3 1.1 ModalBottomSheet. But cant get it to work, it always hides on back button in my attempts so far. Any creative ideas?
Code below still hides bottom sheet on back press
@Composable
fun CancellingBottomSheet(subState: Cancelling, onNavigateBackToBasket: () -> Unit) {
BackHandler {} // disable back while this is showing
ModalBottomSheet(
onDismissRequest = {},
sheetState = rememberModalBottomSheetState(
skipPartiallyExpanded = true,
confirmValueChange = { false },
),
dragHandle = {},
) {
BackHandler {} // disable back while this is showing
Content(subState, onNavigateBackToBasket)
}
}