I have a standard Textfield and I wanna know when user sets focus in it. is there a way to do that?
I tried to set clickable modifier to trigger the event when somebody clicks on it but looks like it doesn't work with TextField:
modifier = Modifier
.clickable {
shouldShowSearchKeyBoard.value = true
},
found the answer.
modifier = Modifier
.focusRequester(focusRequester)
.onFocusChanged {
if (it.isFocused) {
// focused
} else {
// not focused
}
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With