FocusRequester
A hoistable handle that moves keyboard focus to the component it is bound to with focusRequester, so an application event - a validation failure, a toolbar action, a shortcut - can decide what the keyboard drives.
val search = rememberFocusRequester()
Button("Search", onClick = { search.requestFocus() })
TextField(query, onValueChange = { query = it }, modifier = SwingModifier.focusRequester(search))Content copied to clipboard
A requester drives at most one component: binding it to a second one moves it there and leaves the first unbound.