I want to create a text field inside a todo list where when the user presses backspace on an empty text field , it removes itself
from the list , very simple to do as you can see !
Jetpack Compose , Core Text Field does not propogate its key events to parent composables / modifiers if the key event is editable ~~ written in their code
so I tried this and it does not work as expected
Modifier.onKeyEvent {
Log.d("BL_KeyEvent",it.type.toString())
if (it.key.keyCode == Key.Backspace.keyCode) {
if (item.text.isEmpty()) {
onBackspaceRemove()
}
}
false
}
I am just wondering how I could achieve it , since CoreTextField is internal and I have no way to capture key event in a text fielld
onBackspaceRemove()
method – Swartz