I want to catch event when user clicks outside of ModalBottomSheetLayout.
I wrapped ModalBottomSheetLayout with Box which is full size of the screen and set click listener. But Click listener only works when I click on the ModalBottomSheetLayout but not outside. I guess ModalBottomSheetLayout already consumes tap events and doesn't allow me to catch it?
Box(
modifier = Modifier
.clickable {
Log.e("TAG", "clicked!")
}.pointerInput(Unit) {
detectTapGestures {
Log.e("TAG", "tapped!")
}
}
.fillMaxSize()
) {
ModalBottomSheetLayout(
sheetState = sheetState,
sheetContent = {
content()
}
)
}
Is there a way to catch the event of click/tap outside of ModalBottomSheetLayout?