diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/scene/GalleryListFragment.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/scene/GalleryListFragment.kt index cb49a0937..3dd037013 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/scene/GalleryListFragment.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/scene/GalleryListFragment.kt @@ -78,6 +78,7 @@ import androidx.compose.ui.input.nestedscroll.NestedScrollSource import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.platform.LocalView import androidx.compose.ui.res.dimensionResource @@ -222,6 +223,13 @@ fun GalleryListScreen(lub: ListUrlBuilder, navigator: DestinationsNavigator) { } } + val focusManager = LocalFocusManager.current + LaunchedEffect(showSearchLayout) { + if (!showSearchLayout) { + focusManager.clearFocus() + } + } + val animatedSearchLayout by animateFloatMergePredictiveBackAsState( enable = showSearchLayout, animationSpec = tween(FAB_ANIMATE_TIME * 2),