From f19c288bec5c441170ff4a959f9aaa5fb0e0aea7 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Wed, 28 Sep 2022 04:44:06 +0700 Subject: [PATCH] Fix missing focus when single TextField shown (#8098) --- .../presentation/category/components/CategoryDialogs.kt | 2 +- .../main/java/eu/kanade/presentation/components/AppBar.kt | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt b/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt index 2c5d38dc0a..95a7c9a949 100644 --- a/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt +++ b/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt @@ -70,7 +70,7 @@ fun CategoryRenameDialog( category: Category, ) { val (name, onNameChange) = remember { mutableStateOf(category.name) } - val focusRequester = remember { FocusRequester.Default } + val focusRequester = remember { FocusRequester() } AlertDialog( onDismissRequest = onDismissRequest, diff --git a/app/src/main/java/eu/kanade/presentation/components/AppBar.kt b/app/src/main/java/eu/kanade/presentation/components/AppBar.kt index da0718e264..9bda4d05f9 100644 --- a/app/src/main/java/eu/kanade/presentation/components/AppBar.kt +++ b/app/src/main/java/eu/kanade/presentation/components/AppBar.kt @@ -41,7 +41,6 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import eu.kanade.tachiyomi.R -import kotlinx.coroutines.delay @Composable fun AppBar( @@ -225,7 +224,7 @@ fun SearchToolbar( downloadedOnlyMode: Boolean = false, scrollBehavior: TopAppBarScrollBehavior? = null, ) { - val focusRequester = remember { FocusRequester.Default } + val focusRequester = remember { FocusRequester() } AppBar( titleContent = { BasicTextField( @@ -256,8 +255,6 @@ fun SearchToolbar( scrollBehavior = scrollBehavior, ) LaunchedEffect(focusRequester) { - // TODO: https://issuetracker.google.com/issues/204502668 - delay(100) focusRequester.requestFocus() } }