Fix missing focus when single TextField shown (#8098)
This commit is contained in:
parent
e2ce3f68bf
commit
f19c288bec
2 changed files with 2 additions and 5 deletions
|
@ -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,
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue