How can I clear focus? I have tried `FocusRequeste...
# compose
z
How can I clear focus? I have tried
FocusRequester#freeFocus()
but it does not work for me.
l
This got me as well. Currently you do this by getting the AmbientFocusManager and calling clearFocus on it
Api is still in flux though iiuc
z
It works. Thanks a lot.
d
How do you get that
AmbientFocusManager
?
n
AmbientFocusManager.current
d
Can't find that class... is it rather FocusManager ?
n
Oh sorry, looks like it was renamed from
FocusManagerAmbient
in https://android-review.googlesource.com/c/platform/frameworks/support/+/1495457 which won't be released until
alpha08
i.e. try
FocusManagerAmbient.current
d
Thanks! It's working reat!