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?
Ashu
02/08/2022, 7:31 AM
By removing focus I mean cursor should not blink on it, it should not have primary color outlines or keyboard open.
z
Zach Klippenstein (he/him) [MOD]
02/09/2022, 7:56 PM
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.