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

Add Press event prop types and fix a check in Safari #15288

Merged
merged 6 commits into from
Apr 2, 2019

Conversation

necolas
Copy link
Contributor

@necolas necolas commented Apr 1, 2019

  • Adds Press prop types
  • Creates constants for default delay ms
  • Fixes a mouse pointer check for Safari (no pointer events)

Ref #15257

@sizebot
Copy link

sizebot commented Apr 1, 2019

Details of bundled changes.

Comparing: 5ef0d1d...77f2284

react-events

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-events.development.js 0.0% +0.2% 1.16 KB 1.16 KB 617 B 618 B UMD_DEV
react-events.production.min.js 0.0% 🔺+0.5% 682 B 682 B 430 B 432 B UMD_PROD
react-events.production.min.js 0.0% 🔺+0.3% 512 B 512 B 353 B 354 B NODE_PROD
react-events-press.development.js +2.6% +5.8% 10.44 KB 10.71 KB 2.6 KB 2.75 KB UMD_DEV
react-events-press.production.min.js 🔺+0.4% 🔺+0.6% 4.26 KB 4.28 KB 1.52 KB 1.52 KB UMD_PROD
react-events-press.development.js +2.7% +5.7% 10.27 KB 10.54 KB 2.55 KB 2.7 KB NODE_DEV
react-events-press.production.min.js 🔺+0.4% 🔺+0.7% 4.1 KB 4.12 KB 1.47 KB 1.48 KB NODE_PROD
ReactEventsPress-dev.js +3.2% +5.8% 10.52 KB 10.86 KB 2.59 KB 2.74 KB FB_WWW_DEV
ReactEventsPress-prod.js 🔺+0.6% 🔺+1.0% 8.4 KB 8.44 KB 1.92 KB 1.94 KB FB_WWW_PROD
react-events-hover.development.js 0.0% +0.1% 4.74 KB 4.74 KB 1.31 KB 1.31 KB UMD_DEV
react-events-hover.production.min.js 0.0% 🔺+0.1% 2.12 KB 2.12 KB 882 B 883 B UMD_PROD
react-events-hover.development.js 0.0% +0.1% 4.57 KB 4.57 KB 1.27 KB 1.27 KB NODE_DEV
react-events-hover.production.min.js 0.0% 🔺+0.2% 1.96 KB 1.96 KB 824 B 826 B NODE_PROD
react-events-focus.development.js 0.0% +0.1% 2.95 KB 2.95 KB 1.02 KB 1.02 KB UMD_DEV
react-events-focus.production.min.js 0.0% 🔺+0.1% 1.39 KB 1.39 KB 676 B 677 B UMD_PROD
react-events-focus.development.js 0.0% +0.1% 2.78 KB 2.78 KB 992 B 993 B NODE_DEV
react-events-focus.production.min.js 0.0% 🔺+0.3% 1.22 KB 1.22 KB 613 B 615 B NODE_PROD
react-events-swipe.development.js 0.0% +0.1% 5.98 KB 5.98 KB 1.72 KB 1.73 KB UMD_DEV
react-events-swipe.production.min.js 0.0% 🔺+0.1% 2.59 KB 2.59 KB 1.15 KB 1.15 KB UMD_PROD
react-events-swipe.development.js 0.0% +0.1% 5.81 KB 5.81 KB 1.68 KB 1.68 KB NODE_DEV
react-events-swipe.production.min.js 0.0% 🔺+0.2% 2.43 KB 2.43 KB 1.09 KB 1.09 KB NODE_PROD
react-events-drag.development.js 0.0% +0.1% 5.27 KB 5.27 KB 1.57 KB 1.57 KB UMD_DEV
react-events-drag.production.min.js 0.0% 🔺+0.2% 2.33 KB 2.33 KB 1 KB 1 KB UMD_PROD
react-events-drag.development.js 0.0% +0.1% 5.1 KB 5.1 KB 1.53 KB 1.53 KB NODE_DEV
react-events-drag.production.min.js 0.0% 🔺+0.2% 2.17 KB 2.17 KB 971 B 973 B NODE_PROD

Generated by 🚫 dangerJS

event.keyCode is a deprecated API
type PressProps = {
disabled: boolean,
delayLongPress: number,
delayPress: number,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this prop for now. There's no equivalent that we're currently using (only delay for start/end). And if onPress is not cancelled it is always a "completion" event that occurs immediately after onPressEnd.

delayPress: number,
delayPressEnd: number,
delayPressStart: number,
hitSlop: Object,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this prop for now #15261

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.

Nice clean up + additional types!

@trueadm trueadm merged commit 296c439 into facebook:master Apr 2, 2019
@necolas necolas deleted the react-events/misc-press-fixes branch April 3, 2019 20:24
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