Pavel Marchenko
11/15/2020, 1:22 PMEditText view with AndroidView composable, when I press back button with EditText in active state, KeyInputModifier is crashing with "KeyEvent can't be processed because this key input node is not active."
Is there any information on what i'm doing wrong and how to fix this?
After a briefly looking into compose source code I was not able to find any handle to prevent this crash, so I'm just suppressing the crash on activity level inside of dispatchKeyEvent method, is there a better workaround for the issue? (compose 1.0.0-alpha07)Denis Sakhapov
11/15/2020, 2:08 PMWebView inside an AndroidViewPavel Marchenko
11/15/2020, 2:14 PMoverride fun dispatchKeyEvent(event: KeyEvent?): Boolean {
return try {
super.dispatchKeyEvent(event)
} catch (e: IllegalStateException) {
if (event?.keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressedDispatcher.onBackPressed()
true
} else {
throw e
}
}
}
at the first look this was enough to workaround my case, however, I haven't tested if it covers all the cases yetDenis Sakhapov
11/15/2020, 2:23 PM