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
[Tabs] Keyboard navigation does not work with disabled tabs #21233
Comments
Generally this choice should be up to the author. I'm not aware of disabled elements appearing the the tab order by default. Do you have a link for this requirement? |
Hmm, I’m in favour of allowing keyboard navigation to disabled items in group components.
Source: https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets |
The main issue here is that you cant actually navigate through the tabs if you have disabled items. |
@diogofscmariano Could you link the W3C recommendation? All I'm aware of is https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_disabled_controls which basically says: "It depends but be consistent". Which means we're technically good but we should offer customization and a better default. I'm always in favor of following the APG by default but it's clear that there should be an option to remove disabled items from the focus order. |
That was the one I'm talking about: https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_disabled_controls |
+1. Without some form of skipping you can never get to the active tabs between two disabled ones. For what it's worth, antd's demo doesn't have arrow navigation but the disabled tab is skipped and accessible - https://codepen.io/delesseps/pen/mdPEqLj |
This comment has been minimized.
This comment has been minimized.
This is exactly what we have found. We would like to be able to use the arrow keys and allow focus to aria-disabled="true". We have actually implemented our own disabled attribute that does not make buttons/tabs html disabled, but does make them aria-disabled and we style them via CSS to be disabled. We would like: "Keyboard navigation should allow the selected tabs to be focusable but not selectable." Basically line 55: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Tabs/Tabs.js#L55 |
Current behavior
Tabs keyboard navigation does not behave correctly when there are disabled tab items
Expected Behavior 🤔
Keyboard navigation should either allow the selected tabs to be focusable but not selectable or skip them. According to W3C accessibility standards, they should be focusable but not selectable.
Steps to Reproduce 🕹
https://codesandbox.io/s/material-demo-v5ddi?file=/demo.js
Steps:
The text was updated successfully, but these errors were encountered: