dillon1000/react

Commit

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.
Browse files
Changed paths2 files
First-parent comparison
M packages/react-events/src/Press.js ModifiedM packages/react-events/src/__tests__/Press-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…