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

[MenuList] Allow including disabled items in keyboard navigation #19967

Merged
merged 17 commits into from
Mar 26, 2020

Conversation

scottander
Copy link
Contributor

@scottander scottander commented Mar 3, 2020

Small change to make menulist inline with WCAG specifications. (https://www.w3.org/TR/wai-aria-practices/#kbd_disabled_controls)

Disabled items should not be skipped in the menu lists during keyboard navigation as a visually impaired user will not be correctly notified via screen readers.

@eps1lon
Copy link
Member

eps1lon commented Mar 3, 2020

I'm inclined to agree here (especially aria-disabled should not be checked). But we do need a test for this behavior.

@eps1lon eps1lon added accessibility a11y component: menu This is the name of the generic UI component, not the React module! PR: needs test The pull request can't be merged labels Mar 3, 2020
@eps1lon eps1lon changed the title MenulList - Keyboard navigation should not skip disabled [MenuList] Include disabled items in keyboard navigation Mar 3, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Mar 3, 2020

Details of bundle changes.

Comparing: 6d62842...0c0a22e

Details of page changes
bundle Size Change Size Gzip Change Gzip
/guides/localization ▲ +100 B (+0.51% ) 19.9 kB -- -1 B
/api-docs/autocomplete ▲ +30 B (+0.75% ) 4.05 kB -- -1 B
/api-docs/menu-list ▲ +30 B (+2.26% ) 1.36 kB -- -1 B
/api-docs/avatar ▼ -10 B (-0.62% ) 1.6 kB -- -1 B
/api-docs/button ▲ +10 B (+0.43% ) 2.33 kB -- -1 B
/api-docs/input-label ▲ +10 B (+0.55% ) 1.83 kB -- -1 B
/api-docs/tree-view ▼ -10 B (-0.60% ) 1.66 kB -- -1 B
/getting-started/templates/album ▲ +10 B (+0.18% ) 5.66 kB -- -1 B
/performance/table-emotion ▲ +10 B (+0.34% ) 2.97 kB -- -1 B
/system/display ▼ -10 B (-0.15% ) 6.5 kB -- -1 B
/api-docs/svg-icon ▼ -10 B (-0.50% ) 2 kB -- -1 B
/_app -- 34.4 kB -- -1 B
/api-docs/alert-title -- 1.14 kB -- -1 B
/api-docs/alert -- 2.15 kB -- -1 B
/api-docs/app-bar -- 1.69 kB -- -1 B
/api-docs/avatar-group -- 1.26 kB -- -1 B
/api-docs/backdrop -- 1.38 kB -- -1 B
/api-docs/badge -- 1.88 kB -- -1 B
/api-docs/bottom-navigation-action -- 1.55 kB -- -1 B
/api-docs/bottom-navigation -- 1.43 kB -- -1 B
/api-docs/breadcrumbs -- 1.59 kB -- -1 B
/api-docs/button-base -- 2.08 kB -- -1 B
/api-docs/button-group -- 1.95 kB -- -1 B
/api-docs/card-action-area -- 1.32 kB -- -1 B
/api-docs/card-actions -- 1.22 kB -- -1 B
/api-docs/card-content -- 1.2 kB -- -1 B
/api-docs/card-header -- 1.53 kB -- -1 B
/api-docs/card-media -- 1.43 kB -- -1 B
/api-docs/card -- 1.25 kB -- -1 B
/api-docs/checkbox -- 2.07 kB -- -1 B
/api-docs/chip -- 2.19 kB -- -1 B
/api-docs/circular-progress -- 1.8 kB -- -1 B
/api-docs/click-away-listener -- 1.13 kB -- -1 B
/api-docs/collapse -- 1.76 kB -- -1 B
/api-docs/container -- 1.62 kB -- -1 B
/api-docs/css-baseline -- 1.14 kB -- -1 B
/api-docs/dialog-actions -- 1.22 kB -- -1 B
/api-docs/dialog-content-text -- 1.23 kB -- -1 B
/api-docs/dialog-content -- 1.2 kB -- -1 B
/api-docs/dialog-title -- 1.25 kB -- -1 B
/api-docs/dialog -- 2.48 kB -- -1 B
/api-docs/divider -- 1.55 kB -- -1 B
/api-docs/drawer -- 1.87 kB -- -1 B
/api-docs/expansion-panel-actions -- 1.23 kB -- -1 B
/api-docs/expansion-panel-details -- 1.16 kB -- -1 B
/api-docs/expansion-panel-summary -- 1.46 kB -- -1 B
/api-docs/expansion-panel -- 1.7 kB -- -1 B
/api-docs/fab -- 1.86 kB -- -1 B
/api-docs/fade -- 1.17 kB -- -1 B
/api-docs/filled-input -- 2.65 kB -- -1 B
/api-docs/form-control-label -- 1.73 kB -- -1 B
/api-docs/form-control -- 2.1 kB -- -1 B
/api-docs/form-group -- 1.3 kB -- -1 B
/api-docs/form-helper-text -- 1.66 kB -- -1 B
/api-docs/form-label -- 1.59 kB -- -1 B
/api-docs/grid-list-tile-bar -- 1.54 kB -- -1 B
/api-docs/grid-list-tile -- 1.46 kB -- -1 B
/api-docs/grid-list -- 1.37 kB -- -1 B
/api-docs/grid -- 2.29 kB -- -1 B
/api-docs/grow -- 1.23 kB -- -1 B
/api-docs/hidden -- 1.32 kB -- -1 B
/api-docs/icon-button -- 1.85 kB -- -1 B
/api-docs/icon -- 1.54 kB -- -1 B
/api-docs/input-adornment -- 1.68 kB -- -1 B
/api-docs/input-base -- 2.74 kB -- -1 B
/api-docs/input -- 2.61 kB -- -1 B
/api-docs/linear-progress -- 1.78 kB -- -1 B
/api-docs/link -- 1.68 kB -- -1 B
/api-docs/list-item-avatar -- 1.25 kB -- -1 B
/api-docs/list-item-icon -- 1.27 kB -- -1 B
/api-docs/list-item-secondary-action -- 1.22 kB -- -1 B
/api-docs/list-item-text -- 1.54 kB -- -1 B
/api-docs/list-item -- 2 kB -- -1 B
/api-docs/list-subheader -- 1.51 kB -- -1 B
/api-docs/list -- 1.44 kB -- -1 B
/api-docs/menu-item -- 1.46 kB -- -1 B
/api-docs/menu -- 2.13 kB -- -1 B
/api-docs/mobile-stepper -- 1.67 kB -- -1 B
/api-docs/modal -- 2.14 kB -- -1 B
/api-docs/native-select -- 1.83 kB -- -1 B
/api-docs/no-ssr -- 1.09 kB -- -1 B
/api-docs/outlined-input -- 2.76 kB -- -1 B
/api-docs/pagination-item -- 1.71 kB -- -1 B
/api-docs/pagination -- 1.98 kB -- -1 B
/api-docs/paper -- 1.61 kB -- -1 B
/api-docs/popover -- 2.5 kB -- -1 B
/api-docs/popper -- 1.76 kB -- -1 B
/api-docs/portal -- 1.12 kB -- -1 B
/api-docs/radio-group -- 1.23 kB -- -1 B
/api-docs/radio -- 1.89 kB -- -1 B
/api-docs/rating -- 2.25 kB -- -1 B
/api-docs/root-ref -- 1.2 kB -- -1 B
/api-docs/scoped-css-baseline -- 1.15 kB -- -1 B
/api-docs/select -- 2.65 kB -- -1 B
/api-docs/skeleton -- 1.52 kB -- -1 B
/api-docs/slide -- 1.31 kB -- -1 B
/api-docs/slider -- 2.85 kB -- -1 B
/api-docs/snackbar-content -- 1.36 kB -- -1 B
/api-docs/snackbar -- 2.46 kB -- -1 B
/api-docs/speed-dial-action -- 1.67 kB -- -1 B
/api-docs/speed-dial-icon -- 1.29 kB -- -1 B
/api-docs/speed-dial -- 2.05 kB -- -1 B
/api-docs/step-button -- 1.38 kB -- -1 B
/api-docs/step-connector -- 1.29 kB -- -1 B
/api-docs/step-content -- 1.47 kB -- -1 B
/api-docs/step-icon -- 1.33 kB -- -1 B
/api-docs/step-label -- 1.64 kB -- -1 B
/api-docs/step -- 1.38 kB -- -1 B
/api-docs/stepper -- 1.6 kB -- -1 B
/api-docs/swipeable-drawer -- 1.78 kB -- -1 B
/api-docs/switch -- 2.22 kB -- -1 B
/api-docs/tab -- 1.74 kB -- -1 B
/api-docs/table-body -- 1.21 kB -- -1 B
/api-docs/table-cell -- 1.87 kB -- -1 B
/api-docs/table-container -- 1.22 kB -- -1 B
/api-docs/table-footer -- 1.22 kB -- -1 B
/api-docs/table-head -- 1.21 kB -- -1 B
/api-docs/table-pagination -- 2.21 kB -- -1 B
/api-docs/table-row -- 1.43 kB -- -1 B
/api-docs/table-sort-label -- 1.57 kB -- -1 B
/api-docs/table -- 1.43 kB -- -1 B
/api-docs/tabs -- 2.28 kB -- -1 B
/api-docs/text-field -- 2.94 kB -- -1 B
/api-docs/textarea-autosize -- 908 B -- -1 B
/api-docs/toggle-button-group -- 1.56 kB -- -1 B
/api-docs/toggle-button -- 1.55 kB -- -1 B
/api-docs/toolbar -- 1.4 kB -- -1 B
/api-docs/tooltip -- 2.3 kB -- -1 B
/api-docs/tree-item -- 1.53 kB -- -1 B
/api-docs/typography -- 2.33 kB -- -1 B
/api-docs/zoom -- 1.19 kB -- -1 B
/blog/2019-developer-survey-results -- 5.97 kB -- -1 B
/blog/2019 -- 3.86 kB -- -1 B
/blog/april-2019-update -- 2.75 kB -- -1 B
/blog/august-2019-update -- 1.86 kB -- -1 B
/blog/december-2019-update -- 2 kB -- -1 B
/blog/july-2019-update -- 1.75 kB -- -1 B
/blog/june-2019-update -- 1.62 kB -- -1 B
/blog/march-2019-update -- 2.15 kB -- -1 B
/blog/material-ui-v1-is-out -- 6.28 kB -- -1 B
/blog/material-ui-v4-is-out -- 9.31 kB -- -1 B
/blog/may-2019-update -- 1.95 kB -- -1 B
/blog/november-2019-update -- 2.36 kB -- -1 B
/blog/october-2019-update -- 2.1 kB -- -1 B
/blog/september-2019-update -- 2.29 kB -- -1 B
/company/about -- 1.56 kB -- -1 B
/company/contact -- 1.14 kB -- -1 B
/company/jobs -- 1.16 kB -- -1 B
/components/about-the-lab -- 5.55 kB -- -1 B
/components/alert -- 12.5 kB -- -1 B
/components/app-bar -- 30.9 kB -- -1 B
/components/autocomplete -- 111 kB -- -1 B
/components/avatars -- 8.53 kB -- -1 B
/components/backdrop -- 3.2 kB -- -1 B
/components/badges -- 15.1 kB -- -1 B
/components/bottom-navigation -- 6.22 kB -- -1 B
/components/box -- 7.96 kB -- -1 B
/components/breadcrumbs -- 14.3 kB -- -1 B
/components/button-group -- 6.66 kB -- -1 B
/components/buttons -- 24.3 kB -- -1 B
/components/cards -- 16.9 kB -- -1 B
/components/checkboxes -- 16.6 kB -- -1 B
/components/chips -- 21.5 kB -- -1 B
/components/click-away-listener -- 3.38 kB -- -1 B
/components/container -- 3.84 kB -- -1 B
/components/css-baseline -- 5.96 kB -- -1 B
/components/dialogs -- 42.1 kB -- -1 B
/components/dividers -- 12.3 kB -- -1 B
/components/drawers -- 29.3 kB -- -1 B
/components/expansion-panels -- 20.1 kB -- -1 B
/components/floating-action-button -- 10.2 kB -- -1 B
/components/grid-list -- 11.8 kB -- -1 B
/components/grid -- 33.9 kB -- -1 B
/components/hidden -- 10.5 kB -- -1 B
/components/icons -- 22.8 kB -- -1 B
/components/links -- 6.82 kB -- -1 B
/components/lists -- 33 kB -- -1 B
/components/material-icons -- 728 kB -- -1 B
/components/menus -- 23.2 kB -- -1 B
/components/modal -- 11.5 kB -- -1 B
/components/no-ssr -- 5.02 kB -- -1 B
/components/pagination -- 8.15 kB -- -1 B
/components/paper -- 3.33 kB -- -1 B
/components/pickers -- 38.2 kB -- -1 B
/components/popover -- 14.6 kB -- -1 B
/components/popper -- 22.5 kB -- -1 B
/components/portal -- 3.29 kB -- -1 B
/components/progress -- 21.7 kB -- -1 B
/components/radio-buttons -- 15.2 kB -- -1 B
/components/rating -- 10.7 kB -- -1 B
/components/selects -- 28.8 kB -- -1 B
/components/skeleton -- 10.1 kB -- -1 B
/components/slider -- 14.6 kB -- -1 B
/components/snackbars -- 24.8 kB -- -1 B
/components/speed-dial -- 14.6 kB -- -1 B
/components/steppers -- 35.9 kB -- -1 B
/components/switches -- 16 kB -- -1 B
/components/tables -- 177 kB -- -1 B
/components/tabs -- 19.2 kB -- -1 B
/components/text-fields -- 54.7 kB -- -1 B
/components/textarea-autosize -- 2.81 kB -- -1 B
/components/toggle-button -- 10.6 kB -- -1 B
/components/tooltips -- 17.3 kB -- -1 B
/components/transfer-list -- 9.28 kB -- -1 B
/components/transitions -- 10.8 kB -- -1 B
/components/tree-view -- 11.2 kB -- -1 B
/components/typography -- 9.7 kB -- -1 B
/components/use-media-query -- 13.1 kB -- -1 B
/customization/breakpoints -- 15.7 kB -- -1 B
/customization/color -- 21.6 kB -- -1 B
/customization/components -- 37.4 kB -- -1 B
/customization/default-theme -- 8.48 kB -- -1 B
/customization/density -- 9.15 kB -- -1 B
/customization/globals -- 4.65 kB -- -1 B
/customization/palette -- 11.9 kB -- -1 B
/customization/spacing -- 2.49 kB -- -1 B
/customization/theming -- 17.1 kB -- -1 B
/customization/typography -- 11.6 kB -- -1 B
/customization/z-index -- 3.05 kB -- -1 B
/discover-more/backers -- 2.89 kB -- -1 B
/discover-more/changelog -- 1.37 kB -- -1 B
/discover-more/languages -- 3.32 kB -- -1 B
/discover-more/related-projects -- 6.72 kB -- -1 B
/discover-more/roadmap -- 3.67 kB -- -1 B
/discover-more/showcase -- 13.5 kB -- -1 B
/discover-more/team -- 6.51 kB -- -1 B
/discover-more/vision -- 7.03 kB -- -1 B
/getting-started/example-projects -- 6.08 kB -- -1 B
/getting-started/faq -- 31.8 kB -- -1 B
/getting-started/installation -- 7.6 kB -- -1 B
/getting-started/learn -- 8.39 kB -- -1 B
/getting-started/support -- 7.83 kB -- -1 B
/getting-started/supported-components -- 6.19 kB -- -1 B
/getting-started/supported-platforms -- 5.69 kB -- -1 B
/getting-started/templates -- 8.3 kB -- -1 B
/getting-started/templates/blog -- 7.44 kB -- -1 B
/getting-started/templates/checkout -- 11.2 kB -- -1 B
/getting-started/templates/dashboard -- 8.55 kB -- -1 B
/getting-started/templates/pricing -- 7.86 kB -- -1 B
/getting-started/templates/sign-in-side -- 9.31 kB -- -1 B
/getting-started/templates/sign-in -- 9.54 kB -- -1 B
/getting-started/templates/sign-up -- 9.65 kB -- -1 B
/getting-started/templates/sticky-footer -- 1.54 kB -- -1 B
/getting-started/usage -- 9.37 kB -- -1 B
/guides/api -- 17.4 kB -- -1 B
/guides/composition -- 14 kB -- -1 B
/guides/flow -- 2.21 kB -- -1 B
/guides/interoperability -- 14.9 kB -- -1 B
/guides/migration-v0x -- 7.23 kB -- -1 B
/guides/migration-v3 -- 22.3 kB -- -1 B
/guides/minimizing-bundle-size -- 6.74 kB -- -1 B
/guides/responsive-ui -- 4.18 kB -- -1 B
/guides/right-to-left -- 6.7 kB -- -1 B
/guides/server-rendering -- 8.38 kB -- -1 B
/guides/testing -- 8.33 kB -- -1 B
/guides/typescript -- 13.4 kB -- -1 B
/performance/table-component -- 1.44 kB -- -1 B
/performance/table-hook -- 2.23 kB -- -1 B
/performance/table-mui -- 4.42 kB -- -1 B
/performance/table-raw -- 613 B -- -1 B
/performance/table-styled-components -- 2.61 kB -- -1 B
/premium-themes/onepirate -- 7.11 kB -- -1 B
/premium-themes/onepirate/forgot-password -- 1.01 kB -- -1 B
/premium-themes/onepirate/privacy -- 4.44 kB -- -1 B
/premium-themes/onepirate/sign-in -- 1.07 kB -- -1 B
/premium-themes/onepirate/sign-up -- 1.12 kB -- -1 B
/premium-themes/onepirate/terms -- 11.8 kB -- -1 B
/premium-themes/paperbase -- 8.72 kB -- -1 B
/styles/advanced -- 30.2 kB -- -1 B
/styles/api -- 16 kB -- -1 B
/styles/basics -- 17.6 kB -- -1 B
/system/api -- 5.85 kB -- -1 B
/system/basics -- 25.2 kB -- -1 B
/system/borders -- 4.04 kB -- -1 B
/system/flexbox -- 5.72 kB -- -1 B
/system/palette -- 4.29 kB -- -1 B
/system/positions -- 2.46 kB -- -1 B
/system/shadows -- 3.44 kB -- -1 B
/system/sizing -- 3.44 kB -- -1 B
/system/spacing -- 5.97 kB -- -1 B
/system/typography -- 4.22 kB -- -1 B
/versions -- 23.1 kB -- -1 B
docs:chunk:shared -- 68.7 kB -- -1 B
docs:shared:chunk/commons -- 5.99 kB -- -1 B
docs:shared:chunk/framework -- 42.3 kB -- -1 B
docs:shared:runtime/main -- 6.78 kB -- -1 B
docs:shared:runtime/webpack -- 1.24 kB -- -1 B
bundle Size Change Size Gzip Change Gzip
Autocomplete ▲ +186 B (+0.14% ) 136 kB ▲ +83 B (+0.19% ) 42.9 kB
@material-ui/lab ▲ +186 B (+0.09% ) 203 kB ▲ +74 B (+0.12% ) 60.4 kB
useAutocomplete ▲ +137 B (+0.87% ) 15.8 kB ▲ +80 B (+1.43% ) 5.69 kB
MenuList ▲ +86 B (+0.12% ) 70.7 kB ▲ +34 B (+0.15% ) 22.1 kB
Menu ▲ +86 B (+0.09% ) 93.2 kB ▲ +26 B (+0.09% ) 28.8 kB
TextField ▲ +86 B (+0.07% ) 129 kB ▲ +26 B (+0.07% ) 37.8 kB
Select ▲ +86 B (+0.07% ) 120 kB ▲ +22 B (+0.06% ) 35.8 kB
TablePagination ▲ +85 B (+0.06% ) 147 kB ▲ +58 B (+0.13% ) 43.2 kB
@material-ui/core ▲ +85 B (+0.02% ) 362 kB ▲ +46 B (+0.05% ) 99.6 kB
@material-ui/core[umd] ▲ +85 B (+0.03% ) 320 kB ▲ +43 B (+0.05% ) 92.9 kB
PaginationItem ▼ -1 B (-0.00% ) 85.4 kB ▲ +6 B (+0.02% ) 26.4 kB
ToggleButton ▼ -1 B (-0.00% ) 80.7 kB ▲ +6 B (+0.02% ) 25.7 kB
ButtonGroup ▼ -1 B (-0.00% ) 87.8 kB ▲ +5 B (+0.02% ) 27.2 kB
BottomNavigationAction ▼ -1 B (-0.00% ) 80.1 kB ▲ +4 B (+0.02% ) 25.4 kB
ButtonBase ▼ -1 B (-0.00% ) 78.6 kB ▲ +4 B (+0.02% ) 24.7 kB
CardActionArea ▼ -1 B (-0.00% ) 79.7 kB ▲ +4 B (+0.02% ) 25.3 kB
ExpansionPanelSummary ▼ -1 B (-0.00% ) 82.7 kB ▲ +4 B (+0.02% ) 26.3 kB
ListItem ▼ -1 B (-0.00% ) 81.6 kB ▲ +4 B (+0.02% ) 25.6 kB
StepButton ▼ -1 B (-0.00% ) 86.9 kB ▲ +4 B (+0.01% ) 27.5 kB
Tab ▼ -1 B (-0.00% ) 80.9 kB ▲ +4 B (+0.02% ) 25.8 kB
TableSortLabel ▼ -1 B (-0.00% ) 82 kB ▲ +4 B (+0.02% ) 26 kB
Tabs ▼ -1 B (-0.00% ) 89.9 kB ▲ +4 B (+0.01% ) 28.8 kB
Alert ▼ -1 B (-0.00% ) 87.9 kB ▲ +3 B (+0.01% ) 27.9 kB
Breadcrumbs ▼ -1 B (-0.00% ) 85 kB ▲ +3 B (+0.01% ) 27 kB
Button ▼ -1 B (-0.00% ) 84.3 kB ▲ +3 B (+0.01% ) 25.9 kB
Chip ▼ -1 B (-0.00% ) 87.2 kB ▲ +3 B (+0.01% ) 26.8 kB
Fab ▼ -1 B (-0.00% ) 81.4 kB ▲ +3 B (+0.01% ) 25.4 kB
IconButton ▼ -1 B (-0.00% ) 80.7 kB ▲ +3 B (+0.01% ) 25.2 kB
Pagination ▼ -1 B (-0.00% ) 89 kB ▲ +3 B (+0.01% ) 27.5 kB
Radio ▼ -1 B (-0.00% ) 87.7 kB ▲ +3 B (+0.01% ) 27.8 kB
SpeedDial ▼ -1 B (-0.00% ) 90.8 kB ▲ +3 B (+0.01% ) 28.8 kB
SpeedDialAction ▼ -1 B (-0.00% ) 122 kB ▲ +3 B (+0.01% ) 39 kB
Switch ▼ -1 B (-0.00% ) 85.9 kB ▲ +3 B (+0.01% ) 27.1 kB
MenuItem ▼ -1 B (-0.00% ) 82.7 kB ▲ +2 B (+0.01% ) 25.9 kB
Checkbox ▼ -1 B (-0.00% ) 86.7 kB ▲ +1 B (0.00% ) 27.5 kB
@material-ui/styles -- 52 kB -- 15.6 kB
@material-ui/system -- 17.2 kB -- 4.52 kB
AlertTitle -- 68.8 kB -- 21.7 kB
AppBar -- 68.7 kB -- 21.6 kB
Avatar -- 69.8 kB -- 21.9 kB
AvatarGroup -- 70.8 kB -- 22.5 kB
Backdrop -- 72.5 kB -- 22.4 kB
Badge -- 70 kB -- 21.8 kB
BottomNavigation -- 67.1 kB -- 21.1 kB
Box -- 73.6 kB -- 22.4 kB
Card -- 67.5 kB -- 21.2 kB
CardActions -- 66.7 kB -- 20.9 kB
CardContent -- 66.6 kB -- 20.9 kB
CardHeader -- 69.7 kB -- 22 kB
CardMedia -- 67 kB -- 21.1 kB
CircularProgress -- 68.8 kB -- 21.7 kB
ClickAwayListener -- 3.84 kB -- 1.54 kB
Collapse -- 72.7 kB -- 22.5 kB
colorManipulator -- 3.88 kB -- 1.52 kB
Container -- 67.8 kB -- 21.2 kB
CssBaseline -- 66.6 kB -- 21 kB
Dialog -- 87.5 kB -- 27.4 kB
DialogActions -- 66.8 kB -- 20.9 kB
DialogContent -- 66.9 kB -- 21 kB
DialogContentText -- 68.7 kB -- 21.6 kB
DialogTitle -- 68.9 kB -- 21.7 kB
Divider -- 67.3 kB -- 21.2 kB
docs:/ -- 10.8 kB -- -1 B
docs:/_app -- 34.4 kB -- -1 B
Drawer -- 89.2 kB -- 27.2 kB
ExpansionPanel -- 76.2 kB -- 24 kB
ExpansionPanelActions -- 66.7 kB -- 20.9 kB
ExpansionPanelDetails -- 66.6 kB -- 20.9 kB
Fade -- 28.4 kB -- 9.47 kB
FilledInput -- 78.2 kB -- 24.4 kB
FormControl -- 69 kB -- 21.5 kB
FormControlLabel -- 70.1 kB -- 22.1 kB
FormGroup -- 66.7 kB -- 20.8 kB
FormHelperText -- 68 kB -- 21.2 kB
FormLabel -- 68.1 kB -- 21.2 kB
Grid -- 69.8 kB -- 21.9 kB
GridList -- 67.1 kB -- 21.1 kB
GridListTile -- 68.4 kB -- 21.5 kB
GridListTileBar -- 67.9 kB -- 21.3 kB
Grow -- 29 kB -- 9.68 kB
Hidden -- 70.6 kB -- 22.3 kB
Icon -- 67.5 kB -- 21.2 kB
Input -- 77.2 kB -- 24.2 kB
InputAdornment -- 69.7 kB -- 22 kB
InputBase -- 75.3 kB -- 23.7 kB
InputLabel -- 69.9 kB -- 21.6 kB
LinearProgress -- 70 kB -- 21.7 kB
Link -- 71.2 kB -- 22.6 kB
List -- 67 kB -- 20.9 kB
ListItemAvatar -- 66.8 kB -- 20.9 kB
ListItemIcon -- 66.8 kB -- 21 kB
ListItemSecondaryAction -- 66.7 kB -- 20.9 kB
ListItemText -- 69.6 kB -- 22 kB
ListSubheader -- 67.4 kB -- 21.2 kB
MobileStepper -- 72.5 kB -- 22.8 kB
Modal -- 14.9 kB -- 5.23 kB
NativeSelect -- 81.4 kB -- 25.9 kB
NoSsr -- 2.18 kB -- 1.03 kB
OutlinedInput -- 79.2 kB -- 24.7 kB
Paper -- 67 kB -- 20.9 kB
Popover -- 87.6 kB -- 27.2 kB
Popper -- 28.8 kB -- 10.3 kB
Portal -- 2.87 kB -- 1.29 kB
RadioGroup -- 68.4 kB -- 21.3 kB
Rating -- 75.1 kB -- 24.2 kB
RootRef -- 4.61 kB -- 1.77 kB
ScopedCssBaseline -- 67.5 kB -- 21.2 kB
Skeleton -- 67.7 kB -- 21.4 kB
Slide -- 30.4 kB -- 10.1 kB
Slider -- 80.4 kB -- 25.7 kB
Snackbar -- 79.9 kB -- 25.1 kB
SnackbarContent -- 68.2 kB -- 21.3 kB
SpeedDialIcon -- 69.2 kB -- 21.8 kB
Step -- 67.3 kB -- 21.2 kB
StepConnector -- 67.4 kB -- 21.3 kB
StepContent -- 73.8 kB -- 23.1 kB
StepIcon -- 69.2 kB -- 21.6 kB
StepLabel -- 73.2 kB -- 22.7 kB
Stepper -- 69.5 kB -- 22 kB
styles/createMuiTheme -- 22.2 kB -- 7.69 kB
SvgIcon -- 67.7 kB -- 21.2 kB
SwipeableDrawer -- 96.6 kB -- 30.4 kB
Table -- 67.2 kB -- 21.1 kB
TableBody -- 66.8 kB -- 20.9 kB
TableCell -- 68.7 kB -- 21.7 kB
TableContainer -- 66.6 kB -- 20.9 kB
TableFooter -- 66.8 kB -- 20.9 kB
TableHead -- 66.8 kB -- 20.9 kB
TableRow -- 67.1 kB -- 21.1 kB
TextareaAutosize -- 5.19 kB -- 2.17 kB
ToggleButtonGroup -- 67.9 kB -- 21.4 kB
Toolbar -- 67 kB -- 21.1 kB
Tooltip -- 106 kB -- 33.6 kB
TreeItem -- 79.8 kB -- 25.4 kB
TreeView -- 72.9 kB -- 23 kB
Typography -- 68.3 kB -- 21.4 kB
useMediaQuery -- 2.56 kB -- 1.06 kB
Zoom -- 28.4 kB -- 9.59 kB

Generated by 🚫 dangerJS against 0c0a22e

@scottander
Copy link
Contributor Author

thanks @eps1lon I have modified the tests to check for the modified behavior.

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

  1. What visual feedback should we provide when a disabled item is focused? There is no feedback right now.
  2. Should the behavior be the default one? In the WAI link, it seems to be referenced as something common, but does it mean it should be the default? For instance, on macOS, disabled items in a menu aren't focusable. The same goes for Google spreadsheets/docs.
  3. Should the Autocomplete behave identically? It doesn't right now, it could be inconsistent.

@scottander
Copy link
Contributor Author

  • What visual feedback should we provide when a disabled item is focused? There is no feedback right now.
  • Should the behavior be the default one? In the WAI link, it seems to be referenced as something common, but does it mean it should be the default? For instance, on macOS, disabled items in a menu aren't focusable. The same goes for Google spreadsheets/docs.
  • Should the Autocomplete behave identically? It doesn't right now, it could be inconsistent.

A few responses:

-I don't believe based on the wcag specification that any other visual styling is required for disabled & focused elements. That would be a library specific choice for MUI.
-I do believe that if the intent of this library is to conform to accessibility guidelines then the WCAG recommended behavior should be the default.
-I think it would make sense that Autocomplete to behave the same way, although I could not find any specific requirement in the w3 spec to confirm or deny this.

Happy to update this PR as necessary though.

@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 4, 2020

I do believe that if the intent of this library is to conform to accessibility guidelines then the WCAG recommended behavior should be the default.

@scottander I have a hard time finding UI libraries to benchmark against. Do you have some good sources to benchmark? I only have found weak signals.

The following go against it:

The following go in favor of it:

I wonder, should we make a distinction between a "menu bar" and a "dropdown menu"?

Removing focusability from disabled elements can offer users both advantages and disadvantages. Allowing keyboard users to skip disabled elements usually reduces the number of key presses required to complete a task. However, preventing focus from moving to disabled elements can hide their presence from screen reader users who "see" by moving the focus.

In any case, I'm in favor of making it configurable. As for the default value, I have no strong point of view. @eps1lon any preference?

@scottander
Copy link
Contributor Author

@oliviertassinari I do not have any more good examples of libraries following this pattern, although I will say that when trying to develop products that are accessible and do follow s3 specs closely enough to meet WCAG compliance it is generally not enough to follow what other software is doing, as accessibility is generally an after though (if that). I will add this as a configurable option in the props and add some more tests to cover.

Any preference on the name? "enableFocusForDisabledItems" is what I am currently thinking.

@eps1lon could you weigh in on the default value?

@@ -356,71 +356,65 @@ describe('<MenuList> integration', () => {

fireEvent.keyDown(document.activeElement, { key: 'ArrowUp' });

expect(menuitems[3]).to.have.focus;
expect(menuitems[2]).to.have.focus;
});

it('should stay on a single item if it is the only focusable one', () => {
Copy link
Member

Choose a reason for hiding this comment

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

To me this used to test that focus won’t move to non-focusable items that are at the end of the list. The new test tests that a single item keeps focus on arrow down.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

with the new prop i can leave this test as it was.

@joshwooding
Copy link
Member

I think the default should be to allow focus on disabled items and follow the guidelines.

@scottander
Copy link
Contributor Author

@joshwooding @oliviertassinari is there anything else I need to do- to move this PR along? Thanks for the help.

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Thanks for pushing the effort further. I think that we still need to explore the following:

  1. We need visual feedback on the focused disabled items.
  2. The WAI-ARIA explains the pros and cons very well (even for screen readers only). Now, If we take into account that allowing the focus on disabled items harms the experience of none screen readers users, I think that the pragmatic choice is to optimize for the many, hence keep the current behavior as default. But I would need to benchmark on Windows to get a strong point of view on this. So far, it's only based on my experience on the products I use daily (macOS, Gsuite). Feature Request: Skip keyboard navigation of disabled options JedWatson/react-select#3902 is interesting too.
  3. I think that the behavior should be consistent, hence taking the Autocomplete component into account here.

@oliviertassinari oliviertassinari added PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: needs test The pull request can't be merged labels Mar 8, 2020
@diegohaz
Copy link

diegohaz commented Mar 9, 2020

I guess the question is: Is the presence of this element important enough that it should be perceivable even when disabled?

The answer, obviously, depends on the context. And I guess it can only be answered on the app side. So making it configurable is the best option.

Reakit has a focusable prop that can be passed to any MenuItem to make it focusable even when it's disabled. On Tab, this prop is true by default.

@@ -31,6 +31,7 @@ the focus is placed inside the component it is fully keyboard accessible.
| <span class="prop-name">autoFocusItem</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, will focus the first menuitem if `variant="menu"` or selected item if `variant="selectedMenu"` |
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | MenuList contents, normally `MenuItem`s. |
| <span class="prop-name">disableListWrap</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the menu items will not wrap focus. |
| <span class="prop-name">enableFocusForDisabledItems</span> | <span class="prop-type">bool</span> | <span class="prop-default">true</span> | If `true`, will allow focus on disabled items. |
Copy link
Member

Choose a reason for hiding this comment

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

For boolean props we want have false as the default value to enable boolean shorthands like <MenuList disableFocusForDisabledItems />. See https://material-ui.com/guides/api/#property-naming

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems like the consensus is to have this turned off by default so I just updated the current prop default.

@scottander
Copy link
Contributor Author

Thanks for pushing the effort further. I think that we still need to explore the following:

  1. We need visual feedback on the focused disabled items.
  2. The WAI-ARIA explains the pros and cons very well (even for screen readers only). Now, If we take into account that allowing the focus on disabled items harms the experience of none screen readers users, I think that the pragmatic choice is to optimize for the many, hence keep the current behavior as default. But I would need to benchmark on Windows to get a strong point of view on this. So far, it's only based on my experience on the products I use daily (macOS, Gsuite). JedWatson/react-select#3902 is interesting too.
  3. I think that the behavior should be consistent, hence taking the Autocomplete component into account here.

Thanks @oliviertassinari,
1: I will take a look at this one, is adding a style key for disabled focused items going to be enough?
2: In comments for this component it calls out that it should follow aria best practices, to me it seems clear that the standard indicates that you should make disabled items focusable for options in a list box, tabs, menu items and tree views. I am happy to bend with the wind on this one though. Do we need any more consensus on this or can i move forward on the assumption that this will be an opt-in behavior?
3: Once i have confirmation that this behavior should be opt-in i will updated auto-complete as well to follow suite.

@joshwooding
Copy link
Member

It is also worth thinking that the decision of opt-in vs opt-out affects all the above listed components too.

@scottander
Copy link
Contributor Author

scottander commented Mar 11, 2020

@oliviertassinari I believe i have addressed the points you raised if you have a chance can you review the PR again?

@netochaves netochaves mentioned this pull request Mar 16, 2020
1 task
@scottander
Copy link
Contributor Author

...bump @oliviertassinari or @joshwooding or @eps1lon

@oliviertassinari oliviertassinari removed the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Mar 20, 2020
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 22, 2020
@oliviertassinari oliviertassinari force-pushed the menu-list-wcag branch 3 times, most recently from f6b3352 to e94923f Compare March 23, 2020 21:23
@oliviertassinari oliviertassinari added PR: ready to ship and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Mar 25, 2020
@oliviertassinari oliviertassinari merged commit 032cde1 into mui:master Mar 26, 2020
@oliviertassinari
Copy link
Member

@scottander Thanks

@scottander
Copy link
Contributor Author

No problem and thanks for the help getting this one over the finish line @oliviertassinari

@scottander scottander deleted the menu-list-wcag branch March 26, 2020 23:55
@eps1lon eps1lon changed the title [MenuList] Include disabled items in keyboard navigation [MenuList] Allow including disabled items in keyboard navigation Mar 27, 2020
EsoterikStare pushed a commit to EsoterikStare/material-ui that referenced this pull request Mar 30, 2020
ryancogswell added a commit to ryancogswell/material-ui that referenced this pull request Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants