Hi, does TextField always keep focus? I want it to...
# compose
a
Hi, does TextField always keep focus? I want it to loose focus whenever I click outside of it but that isn't happening. Even when I open a dialog box, after the dialog box closes it keeps focus. How can I remove TextField focus whenever I click outside of it?
By removing focus I mean cursor should not blink on it, it should not have primary color outlines or keyboard open.
z
You can clear focus manually by calling
clearFocus()
on the
FocusManager
obtained from
LocalFocusManager
. You could put a
pointerInput
modifier around your screen that would handle unconsumed clicks and clear focus.