Dumb question: how to close the keyboard when the user press the imeAction button in a `TextField`? ...
n
Dumb question: how to close the keyboard when the user press the imeAction button in a
TextField
?
Copy code
TextField(
    value = text.value,
    keyboardType = KeyboardType.Text,
    imeAction = ImeAction.Done,
    onImeActionPerformed = {
        // TODO how to close the keyboard?
    },
    onValueChange = { s -> text.value = s }
)
👍🏻 1
k
you can request for the context via ambient:
Copy code
val context = +ambient(ContextAmbient)
if I remember correctly, context is enought to close the keyboard
n
yeah… you’re right 😉 thanks @kioba I asked that at 2am. Sorry for that 😄
👍 3