I am facing issue with the imeAction in the State ...
# compose
j
I am facing issue with the imeAction in the State Kotlin CodeLab. When done is pressed at that time the value of text is always returned empty. Also, when viewed in the imeAction the value of text comes back as empty. Source code:
Copy code
onImeActionPerformed = { action, softKeyboardController ->
    if (action == ImeAction.Done) {
        onImeAction()
        softKeyboardController?.hideSoftwareKeyboard()
    }
},
Handling on the submit callback:
Copy code
val submit = {
    onItemComplete(TodoItem(text))
    setIcon(TodoIcon.Default)
    setText("")
}
Video:
s
Similar known issue – it's caching the ime lambda in a way that triggers this. Should be fixed in an upcoming release. You can "fix" it now by changing the capture to a type of
State<String>
instead of
String
.
👍 2