Closed igordmn closed 4 months ago
Will be fixed in integration
branch
I guess the fix will be to focus the first focusable element instead of "Enter"?
The fix will be to skip requesting focus if it is already in focus. It is the only way to behave when we activate/deactivate window.
I couldn't immediately find a way to check if something is already focused. When "nothing" is focused, the root node has the focus.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Compose 1.6.20-dev1663
fun main() = SwingUtilities.invokeLater { val panel = ComposePanel() panel.setContent { var isFocused by remember { mutableStateOf(false) } Box(Modifier .onFocusChanged { isFocused = it.isFocused } .focusTarget() .border(1.dp, if (isFocused) Color.Red else Color.Transparent) .padding(8.dp) ) { TextField("", {}, singleLine = true) } }
}