Move BottomSheet BackHandler to the correct place

This commit is contained in:
vfsfitvnm 2022-06-22 17:50:29 +02:00
parent 4e5f17de23
commit ca90213eaf

View file

@ -74,8 +74,6 @@ fun BottomSheet(
mutableStateOf(state.value)
}
BackHandler(enabled = !state.isCollapsed, onBack = state.collapse)
Box {
if (handleOutsideInteractionsWhenExpanded && !state.isCollapsed) {
Spacer(
@ -157,6 +155,7 @@ fun BottomSheet(
.fillMaxSize()
) {
if (!state.isCollapsed) {
BackHandler(onBack = state.collapse)
content()
}