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-interactins] FocusTable tabScope handling+tabIndex control #16922

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Sep 27, 2019

This PR provides FocusTable with support for handling keyboard tabbing behavior control. Specifically, when a scope is provided as a prop via tabScope, then the FocusTable will attempt to automate the control and setting of host component's tabIndex. This ensures that a single keyboard tab will move to the next browser tab focusable element after the table. Tabbing back into the FocusTable should resume the previously selected cells focus.

Under the hood, we proxy the tabIndex descriptor of the given HTMLElement and track the tabIndex value so we can correctly reset to the right value (similar to how we track input values). Otherwise we pragmatically control the value to -1 when we don't want a field to be browser tab focusable.

@sizebot
Copy link

sizebot commented Sep 27, 2019

Details of bundled changes.

Comparing: b9811ed...c7cd535

react-interactions

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-interactions-events/focus.development.js 0.0% -0.0% 11.81 KB 11.81 KB 2.57 KB 2.57 KB UMD_DEV
react-interactions-events/tap.development.js 0.0% -0.0% 17.52 KB 17.52 KB 3.74 KB 3.74 KB UMD_DEV
ReactFocusTable-dev.js +11.9% +9.7% 8.11 KB 9.08 KB 1.74 KB 1.91 KB FB_WWW_DEV
react-interactions-events/context-menu.development.js 0.0% -0.1% 2.68 KB 2.68 KB 1007 B 1006 B UMD_DEV
react-interactions-events/context-menu.production.min.js 0.0% -0.1% 1.39 KB 1.39 KB 729 B 728 B UMD_PROD
react-interactions-events/input.production.min.js 0.0% -0.1% 1.84 KB 1.84 KB 984 B 983 B UMD_PROD
ReactFocusControl-dev.js +31.7% +41.4% 3.49 KB 4.59 KB 905 B 1.25 KB FB_WWW_DEV
ReactFocusControl-prod.js 🔺+32.1% 🔺+34.5% 2.74 KB 3.61 KB 785 B 1.03 KB FB_WWW_PROD
react-interactions-events/context-menu.development.js 0.0% -0.1% 2.49 KB 2.49 KB 961 B 960 B NODE_DEV
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-events/input.production.min.js 0.0% -0.1% 1.66 KB 1.66 KB 917 B 916 B NODE_PROD
react-interactions-accessibility/focus-manager.production.min.js 0.0% -0.1% 1.26 KB 1.26 KB 708 B 707 B NODE_PROD
react-interactions-events/hover.development.js 0.0% -0.1% 7 KB 7 KB 1.56 KB 1.55 KB UMD_DEV
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
react-interactions-events/hover.development.js 0.0% -0.1% 6.82 KB 6.82 KB 1.51 KB 1.51 KB NODE_DEV
react-interactions-accessibility/focus-table.development.js +11.4% +8.7% 8.32 KB 9.27 KB 1.8 KB 1.95 KB NODE_DEV
react-interactions-events/hover.production.min.js 0.0% -0.1% 2.94 KB 2.94 KB 1.07 KB 1.07 KB NODE_PROD
react-interactions-accessibility/focus-table.production.min.js 🔺+14.3% 🔺+10.7% 2.59 KB 2.96 KB 1.07 KB 1.18 KB NODE_PROD
react-interactions-accessibility/focus-list.production.min.js 0.0% -0.3% 1.57 KB 1.57 KB 790 B 788 B NODE_PROD
ReactFocusTable-prod.js 🔺+4.7% 🔺+8.2% 7.34 KB 7.68 KB 1.56 KB 1.69 KB FB_WWW_PROD
react-interactions-events/focus.development.js 0.0% -0.0% 11.63 KB 11.63 KB 2.53 KB 2.53 KB NODE_DEV
react-interactions-events/tap.development.js 0.0% -0.0% 17.34 KB 17.34 KB 3.69 KB 3.68 KB NODE_DEV
react-interactions-events/press.production.min.js 0.0% 🔺+0.1% 2.33 KB 2.33 KB 1 KB 1 KB NODE_PROD
react-interactions-events/keyboard.development.js 0.0% -0.0% 5.79 KB 5.79 KB 2.15 KB 2.15 KB UMD_DEV
react-interactions-events/swipe.development.js 0.0% -0.1% 6 KB 6 KB 1.63 KB 1.62 KB UMD_DEV
react-interactions-events/keyboard.production.min.js 0.0% 🔺+0.1% 2.44 KB 2.44 KB 1.22 KB 1.22 KB UMD_PROD
react-interactions-events/keyboard.development.js 0.0% -0.0% 5.6 KB 5.6 KB 2.11 KB 2.11 KB NODE_DEV
react-interactions-accessibility/focus-control.development.js +31.2% +39.5% 3.53 KB 4.64 KB 947 B 1.29 KB NODE_DEV
react-interactions-events/keyboard.production.min.js 0.0% -0.1% 2.26 KB 2.26 KB 1.17 KB 1.17 KB NODE_PROD
react-interactions-accessibility/focus-control.production.min.js 🔺+32.3% 🔺+31.8% 1.25 KB 1.65 KB 613 B 808 B NODE_PROD

Generated by 🚫 dangerJS against c7cd535

@trueadm trueadm merged commit 10c7dfe into facebook:master Sep 30, 2019
@trueadm trueadm deleted the table-tab-handle branch September 30, 2019 09:41
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