-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix: press event order #1696
fix: press event order #1696
Conversation
@pierrezimmermannbam I'm messing with User Event |
@mdjastrzebski: interesting observation in regards to 'short' presses. I was able to reproduce this in my own experimentation too. Do you know if this phenomenon is documented somewhere (whether that be actual documentation or a reference to source code)? |
@winghouchan The best source is probably Pressability code: https://github.com/facebook/react-native/blob/33e1ae13f88979d8346e4f5ddd4cbce500a16999/packages/react-native/Libraries/Pressability/Pressability.js#L342 There is the code path when Then there is the code path for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work investigating the issue! The fix is correct but I suggested a slightly different approach
This PR has been released in v12.8.1 🎉 |
Summary
Resolves: #1687
Reverses
pressOut
andpress
event order so that it matches experimental data for regular presses:pressIn
,pressOut
press
.The previous setup matched edge case for very short (< 130ms) presses, when order was:
pressIn
press
pressOut
Scope
See experiments: https://github.com/callstack/react-native-testing-library/wiki/Press-Events
Test plan
All tests pass