I found this document stating that Tab and Shift+Tab are supposed to automatically move the focus to the next/previous focusable element but I supposed this is only for Compose Desktop because it's not working on a JS app.
It's easy to add by re-adding manually the moveFocusOnTab modifier that used to be on that document:
fun Modifier.moveFocusOnTab() = composed {
val focusManager = LocalFocusManager.current
onPreviewKeyEvent {
if (it.type == KeyEventType.KeyDown && it.key == Key.Tab) {
focusManager.moveFocus(
if (it.isShiftPressed) FocusDirection.Previous else FocusDirection.Next
)
true
} else {
false
}
}
}
But it'd be cool if this was happening automatically.
I found this document stating that Tab and Shift+Tab are supposed to automatically move the focus to the next/previous focusable element but I supposed this is only for Compose Desktop because it's not working on a JS app.
It's easy to add by re-adding manually the
moveFocusOnTab
modifier that used to be on that document:But it'd be cool if this was happening automatically.
Thanks!