Skip to content
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: add onPressMove and pressRetentionOffset to Press #15374

Merged

Conversation

necolas
Copy link
Contributor

@necolas necolas commented Apr 10, 2019

This implementation differs from equivalents in React Native in the following ways:

  1. A move during a press will not cancel onLongPress.
  2. A move to outside the retention target will cancel all pending events and not reactivate when moved back within the retention target.

We can change this in the future but I think we'll want to refactor the state machine first.

Ref #15257

@sizebot
Copy link

sizebot commented Apr 10, 2019

Details of bundled changes.

Comparing: b4bc33a...a201ea9

react-events

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-events.production.min.js 0.0% -0.2% 682 B 682 B 431 B 430 B UMD_PROD
react-events.production.min.js 0.0% -0.3% 512 B 512 B 354 B 353 B NODE_PROD
react-events-press.development.js +36.6% +42.8% 12.88 KB 17.6 KB 3.02 KB 4.31 KB UMD_DEV
react-events-press.production.min.js 🔺+36.8% 🔺+41.9% 5.11 KB 6.99 KB 1.73 KB 2.46 KB UMD_PROD
react-events-press.development.js +37.1% +43.8% 12.71 KB 17.43 KB 2.98 KB 4.28 KB NODE_DEV
react-events-press.production.min.js 🔺+38.1% 🔺+43.4% 4.94 KB 6.83 KB 1.68 KB 2.41 KB NODE_PROD
ReactEventsPress-dev.js +21.0% +18.0% 13.06 KB 15.8 KB 3.04 KB 3.58 KB FB_WWW_DEV
ReactEventsPress-prod.js 🔺+22.2% 🔺+21.7% 10.44 KB 12.76 KB 2.19 KB 2.66 KB FB_WWW_PROD
react-events-hover.development.js 0.0% -0.1% 6.74 KB 6.74 KB 1.79 KB 1.79 KB UMD_DEV
react-events-hover.development.js 0.0% -0.1% 6.57 KB 6.57 KB 1.75 KB 1.74 KB NODE_DEV
react-events-focus.development.js 0.0% -0.1% 3.29 KB 3.29 KB 1.11 KB 1.11 KB UMD_DEV
react-events-focus.development.js 0.0% -0.1% 3.12 KB 3.12 KB 1.06 KB 1.06 KB NODE_DEV
react-events-swipe.development.js 0.0% -0.0% 8.29 KB 8.29 KB 2.57 KB 2.57 KB UMD_DEV

Generated by 🚫 dangerJS

Copy link
Contributor

@trueadm trueadm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments about using passive events but otherwise good to me. CI seems to be failing too.

This implementation differs from equivalents in React Native in the following ways:

1. A move during a press will not cancel onLongPress.
2. A move to outside the retention target will cancel the press and not
reactivate when moved back within the retention target.
@necolas necolas force-pushed the react-events/press-move-and-retention branch from efbd19b to a201ea9 Compare April 10, 2019 17:34
@necolas necolas merged commit 7fc91f1 into facebook:master Apr 10, 2019
@necolas necolas deleted the react-events/press-move-and-retention branch May 3, 2019 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants