-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
React Events: consolidate logic for Press event component #15451
React Events: consolidate logic for Press event component #15451
Conversation
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 savings in code size. Also CI is failing too for some reason.
Added a link to an interactive demo running this patch. Will start doing this for most PRs that can benefit from reviewers checking interactions for themselves. |
6124563
to
a6c3bc7
Compare
Details of bundled changes.Comparing: 5857c89...a6c3bc7 react-events
Generated by 🚫 dangerJS |
Stacks on #15449. Demo integrating this patch: https://fburl.com/nfye4390
Refactor of
Press
and additional regression coverage.The logic for "start", "move", "end", and "cancel" events is consolidated into a single block to reduce duplication and improve consistency of the UX across input-types. Also reduces code size.
The bailout logic for anchor tags is removed since we
preventDefault
forclick
by default. We can discuss scenarios where it makes sense to limit functionality around interactions on anchor tags.The logic for ignoring emulated events is simplified and improved. Pointer events can produce emulated touch (immediately after pointer) and mouse events (delayed) which is now accounted for and tested.
Ref #15257