Clear focus when opening a bottom sheet

This commit is contained in:
MM20 2024-05-24 18:20:01 +02:00
parent dbbe5fc2c7
commit 64ce07475c
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -56,6 +56,7 @@ import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntRect
@ -84,6 +85,11 @@ fun BottomSheetDialog(
) {
val scope = rememberCoroutineScope()
val focusManager = LocalFocusManager.current
LaunchedEffect(Unit) {
focusManager.clearFocus(true)
}
var isOpenAnimationFinished by remember { mutableStateOf(false) }
val draggableState = remember {