SearchToolbar: Better physical keyboard support (#8529)

Make enter keys behave like search key of on-screen keyboard
This commit is contained in:
Ivan Iskandar
2022-11-13 22:59:23 +07:00
committed by GitHub
parent c31cf2a03a
commit acd43005df
4 changed files with 40 additions and 11 deletions

View File

@@ -54,6 +54,7 @@ import eu.kanade.presentation.components.Divider
import eu.kanade.presentation.components.EmptyScreen
import eu.kanade.presentation.components.Scaffold
import eu.kanade.presentation.more.settings.Preference
import eu.kanade.presentation.util.runOnEnterKeyPressed
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.isLTR
@@ -108,7 +109,8 @@ class SettingsSearchScreen : Screen {
onValueChange = { textFieldValue = it },
modifier = Modifier
.fillMaxWidth()
.focusRequester(focusRequester),
.focusRequester(focusRequester)
.runOnEnterKeyPressed(action = focusManager::clearFocus),
textStyle = MaterialTheme.typography.bodyLarge
.copy(color = MaterialTheme.colorScheme.onSurface),
singleLine = true,