-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
TextInput onKeyPress fires after the onChange #48636
Comments
Tip Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Tip Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Hi @ncpa0cpl, |
Warning Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:
|
did you perhaps ran the reproducer via the "Web" runtime in the snack? it does work properly there, but when using the android emulator the issue is occurring consistently, I have not seen it work properly even once, it is always as shown in the video |
After some more investigating I think this is related to the Android version. I tested this on a emulator with android 10, 12 and 13. the behavior is different between them, 13 works as expected but on 10 and 12 the |
Description
According to the docs the keyPress event should fire before the change event. That does not seem to be the case though, I've run into this on a physical device in a project (doesn't use expo) I can't share and also reproduced this on a online playground for react native with expo.
In the video you can see that the
console.log
in the onChange callback happens before thecosnole.log
in theonKeyPress
callback:Screencast.From.2025-01-13.14-04-04.mp4
Steps to reproduce
React Native Version
tested on 0.74.5 and 0.76.6
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/@ncpa/rn-bug
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: