https://kotlinlang.org logo
#compose
Title
# compose
b

buszi0809

01/07/2021, 5:43 PM
How to force text field to lose focus? I can't exit edit state after ime action etc
4
r

Ralston Da Silva

01/12/2021, 9:37 PM
The user can click outside the text field to clear focus. If you want to clear focus programatically you can do the following:
Copy code
// Fetch the focusmanager ambient by using this statement within a @Composable function.
val focusManager = AmbientFocusManager.current

// Use this function to clear focus.
focusManager.clearFocus()
3 Views