dillon1000/react
Commit
Browse files React Events: consolidate logic for Press event component (#15451)
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 for click 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.
Changed paths2 files
First-parent comparisonpackages/react-events/src/Press.js ModifiedM packages/react-events/src/__tests__/Press-test.internal.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…