-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] onKeyPress event not fired for numeric keyboard #19507
Comments
It looks like your issue may be missing some necessary information. Can you run |
Let me take a look. |
Any updates? This issue is still present with |
The problem is still there using:
Going top left to bottom right on all keys gives me the following output:
Note: The enter key also doesn't work ( I was actually hoping to do something onSubmit, suggestions welcome ;) ) |
For the latest React Native, in a TextInput, typing numbers does not fire Android 7.0 has been working fine for me. Environment: Packages: (wanted => installed) |
I also have the same problem |
Any update on this issue? @joshjhargreaves |
Hi, I'm having the same problem with numeric keyboards not firing the onKeyPress event, which prevents my custom component from working in Android. info |
Related: #18339 |
No solution yet? |
Still facing the same issue even on the latest version |
I am facing it with rn |
There is a workaround you can use.
checkNumber is defined as:
|
@siddhi-sandy Unfortunately this works only if text did change. I need it for case when text stays the same and I press a key. |
+1 issue still persist rn 0.60.4 |
Any workaround or solution??? |
@fabriziobertoglio1987 thx!, i saw your commit, i'll test it and let you know. We can close this issue. |
@suberbawer thanks here a guide to build from source https://github.com/facebook/react-native/wiki/Building-from-source#publish-your-own-version-of-react-native if you have issues ask, I will assist you as I can. Biggest Step is installing ndk, but it was pretty easy for me using android studio depencies manager/updater |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
The bug is unsolved and should stay opened. |
@mieszko4 Any solution for your issue? |
Nope, it works for me only if the entered character is different form the value of the input. I haven't touch this since then. Working good enough for my case. |
I made it work with both |
@iagormoraes requires changes in ReactAndroid as in my pr #29046 |
Having the same issue here. Trying to build a 2FA which the best UX is to, whenever a new character is pressed, it fills the next input field. However, without onKeyPress checking for numbers pressed on Android, I can`t get it done properly. Has anyone done it by any chance? |
@victorlmtavares @fabriziobertoglio1987's PR #29046 has a fix for it. Hopefully it land soon. Else you can build it yourself but who got time for that :) If you could add a thumbs up there it will be great. |
same problem here |
This problem is still there. |
Problem still exists |
Yes, it still exists.💔 |
Correct, the issue is still there, i.e. on Android 11.0 and using Expo SDK 42 (React Native 0.63), when using on the
However when using the It seems the issue was technically fixed in this PR, so not sure if a regression happened at some point: Can we get any help, or workaround on this? |
Ignore my above comment, it actually does work correctly, sorry for the noise. My issue was when combining |
This Issue has still not been fixed :( |
Hi, react-native: 0.65.1 I use TextInput component with keyboardType: 'num-pad', |
Same error here! |
same |
still exists |
but seems to work if you just implement onChangeText property with an empty arrow function, then onKeyPress will be fired for Android everytime! |
Still persists, Using this
|
Guys, I had this problem, but it got resolved after I removed |
"react-native": "0.71.3" onChangeText => not triggering on Android with numeric keyboard. onChange => callback works for me both on Android and IOS with numeric keyboard! |
Any fix? |
Environment
OS: macOS High Sierra 10.13.4
Node: 8.9.4
Yarn: 1.6.0
npm: 6.0.1
Watchman: 4.7.0
Xcode: Xcode 9.3.1 Build version 9E501
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.55.0 => 0.55.0
Description
When using the non-default keyboard on Android, the onKeyPress event is not (or partly) fired.
For example, when using the numeric keyboard, pressing a number does not fire the event, but pressing the backspace does fire the event.
It works fine for the default keyboard, or on iOS
Steps to Reproduce
Issue can be seen with this snack: https://snack.expo.io/B1amtl3ym
Steps to reproduce:
Expected Behavior
Call the onKeyPress callback when a key is pressed on the not default keyboard on android
Actual Behavior
onKeyPress callback is NOT called for a numeric keyboard. (for the digits)
The text was updated successfully, but these errors were encountered: