Closed theolm closed 2 weeks ago
@danielleontiev After investigating this issue for some time I came to some conclusions:
I think this is probably a bug in the keyboard itself. You are using LineageOS, right? I know this ROM has a pretty bad keyboard, do you mind trying a different one?
The ones that I tested and know it's working 100%
I'm closing this issue since there is nothing that I can do on my side.
Hey! Yes, I am using LineageOS. I've tried couple of keyboards that you've suggested and they work as expected. So, it's indeed looks like a bug in the LineageOS's keyboard.
I wonder what is the exact issue with that keyboard and is it possible to implement some workaround for it?
Unfortunately, there is no workaround that I can implement on my side.
Basically, there is a modifier to capture the pressed key
Modifier.onKeyEvent { keyPressed ->
// if keyPressed == backspace remove country code
}
The issue is that the lineage keyboard never calls this callback... so there is really no way for me to know when the user pressed the backspace.
I've found a lengthy discussion about this issue here: https://issuetracker.google.com/issues/36964165.
It turns out that the AOSP keyboard does not send KEYCODE_DEL
, not because it's faulty or buggy, but simply because it chooses not to.
According to the people in the thread, there are multiple reasons why key code events should not be relied upon in application logic. These range from the inability to guarantee the delivery of such events in some cases—making them unreliable in general—to various UX considerations.
I can't comment on whether this approach is fully justified or not, but the reality is that this behavior is deliberate and isn't going to change.
Nice finding. (I searched the issue tracker and didn't find this issue!) Unfortunately, there is nothing that I can do on my side to make this feature work with AOSP keyboards =(
If you have any idea please let me know.
1) The simplest option is to have an icon near the gear icon that deletes everything, including the default code, without affecting the default saved value. 2) The country code now has its own input field, but it could simply be the initial value of the phone number input. In that case, erasing it wouldn't depend on key codes at all.
Steps to reproduce
double backspace should remove the default code but it's not working.
Expected behavior
The code should be erased
Actual behavior
It does not work
Crash logs
No response
App version
0.10.0
Device
Galaxy Flip 5
Other details
No response
Acknowledgements