I've been trying to catch the keyboard's events within a TextInput
in react-native
.
By reading the component's doc (https://facebook.github.io/react-native/docs/textinput.html) I noticed the onKeyPress
function which fits perfectly what I need. But it is labelled as ios
only. I haven't found anything about an android
workaround except this issue (https://github.com/facebook/react-native/issues/1882) which has been inactive for a couple months now ...
What I'd need to do is calling a specific method when Backspace
is pressed and it looks like it can only be done for ios
for now ...
Do you guys know any workaround for this ?
Thanks in advance :)
onKeyPress
is now supported on Android.
From version v0.55.2
(commit)
Note hat the hardware keyboard inputs are not supported on Android, only the soft keyboard inputs.
Meaning, if you test this on an Android emulator and you type on your computer keyboard, those inputs are not be handled. So, go ahead and press the soft keyboard on the emulator with the mouse.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With