Fix behaviour of Enter and Tab hardware keys in TextFields (#216)
* Fix behaviour of Enter and Tab hardware keys in TextFields * Add changelog
This commit is contained in:
committed by
GitHub
parent
411109b8a9
commit
cd09c15df4
+4
-2
@@ -99,8 +99,10 @@ fun OutlinedTextField(
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
fun Modifier.onTabOrEnterKeyFocusNext(focusManager: FocusManager): Modifier = onPreviewKeyEvent { event ->
|
||||
if (event.type == KeyEventType.KeyUp && (event.key == Key.Tab || event.key == Key.Enter)) {
|
||||
focusManager.moveFocus(FocusDirection.Down)
|
||||
if (event.key == Key.Tab || event.key == Key.Enter) {
|
||||
if (event.type == KeyEventType.KeyUp) {
|
||||
focusManager.moveFocus(FocusDirection.Down)
|
||||
}
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user