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-interactions] TabFocus -> FocusManager #16874

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Sep 24, 2019

This PR makes some key alterations to the TabFocus component and its tests. It also makes some changes to the FocusWithin event responder.

FocusManager component

  • Renames TabFocus to FocusManager, as this is now a more generic focus handling component, it actually does a job of managing focus within its scope.
  • Adds restoreFocus
  • Adds autoFocus
  • Change contain prop to containFocus so its consistent with other props
  • Ensure any user focus outside of the scope correctly gets restored
  • Tidied up tests a bit more

FocusWithin responder

  • Adds continuePropagation to the focus event
  • Adds onBlurWithin event (needed for FocusManager)

@sizebot
Copy link

sizebot commented Sep 24, 2019

Details of bundled changes.

Comparing: 8b580a8...5142e7f

react-interactions

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-interactions-events/focus.development.js +7.5% +8.6% 10.93 KB 11.75 KB 2.36 KB 2.56 KB UMD_DEV
react-interactions-events/press.development.js 0.0% -0.0% 9.02 KB 9.02 KB 2.66 KB 2.66 KB UMD_DEV
react-interactions-events/focus.production.min.js 🔺+3.8% 🔺+3.4% 4.1 KB 4.26 KB 1.39 KB 1.44 KB UMD_PROD
react-interactions-events/press.production.min.js 0.0% -0.1% 2.62 KB 2.62 KB 1.09 KB 1.09 KB UMD_PROD
react-interactions-events/tap.production.min.js 0.0% -0.0% 6.23 KB 6.23 KB 2.35 KB 2.35 KB UMD_PROD
react-interactions-events/context-menu.development.js 0.0% +0.1% 2.68 KB 2.68 KB 1006 B 1007 B UMD_DEV
react-interactions-events/scroll.production.min.js 0.0% 🔺+0.1% 2.63 KB 2.63 KB 1.15 KB 1.15 KB UMD_PROD
react-interactions-events/input.development.js 0.0% +0.1% 4.34 KB 4.34 KB 1.4 KB 1.4 KB NODE_DEV
react-interactions-accessibility/focus-manager.development.js n/a n/a 0 B 2.75 KB 0 B 1.03 KB NODE_DEV
react-interactions-accessibility/focus-manager.production.min.js n/a n/a 0 B 1.26 KB 0 B 708 B NODE_PROD
react-interactions-events/press-legacy.production.min.js 0.0% -0.0% 7.31 KB 7.31 KB 2.77 KB 2.77 KB UMD_PROD
ReactFocusManager-dev.js n/a n/a 0 B 2.73 KB 0 B 1010 B FB_WWW_DEV
ReactFocusManager-prod.js n/a n/a 0 B 2.33 KB 0 B 866 B FB_WWW_PROD
react-interactions-accessibility/focus-table.development.js 0.0% -0.1% 6.88 KB 6.88 KB 1.63 KB 1.63 KB NODE_DEV
react-interactions-accessibility/focus-table.production.min.js 0.0% -0.1% 2.31 KB 2.31 KB 1002 B 1001 B NODE_PROD
react-interactions-events/focus.development.js +7.6% +8.6% 10.74 KB 11.56 KB 2.32 KB 2.51 KB NODE_DEV
react-interactions-events/focus.production.min.js 🔺+4.0% 🔺+4.7% 3.93 KB 4.09 KB 1.32 KB 1.39 KB NODE_PROD
react-interactions-events/keyboard.development.js 0.0% -0.0% 5.75 KB 5.75 KB 2.14 KB 2.14 KB UMD_DEV
react-interactions-events/swipe.development.js 0.0% -0.1% 6 KB 6 KB 1.63 KB 1.63 KB UMD_DEV
ReactEventsFocus-dev.js +7.9% +8.4% 10.68 KB 11.52 KB 2.34 KB 2.53 KB FB_WWW_DEV
ReactEventsFocus-prod.js 🔺+5.0% 🔺+5.0% 8.04 KB 8.44 KB 1.69 KB 1.78 KB FB_WWW_PROD
react-interactions-events/drag.development.js 0.0% -0.0% 6.98 KB 6.98 KB 2.21 KB 2.21 KB NODE_DEV
react-interactions-accessibility/focus-control.production.min.js 0.0% -0.2% 1.26 KB 1.26 KB 617 B 616 B NODE_PROD

Generated by 🚫 dangerJS against 5142e7f

Add continuePropagation to focus events

Remove empty FocusList

Remove empty FocusList

Remove empty FocusList
@trueadm trueadm merged commit ebc299f into facebook:master Sep 24, 2019
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