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

[Menu] Disabled MenuItems still accessible via keyboard #13464

Closed
2 tasks done
kylane opened this issue Oct 31, 2018 · 2 comments · Fixed by #15360
Closed
2 tasks done

[Menu] Disabled MenuItems still accessible via keyboard #13464

kylane opened this issue Oct 31, 2018 · 2 comments · Fixed by #15360
Labels
accessibility a11y component: menu This is the name of the generic UI component, not the React module! priority: important This change can make a difference

Comments

@kylane
Copy link

kylane commented Oct 31, 2018

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The keyboard should not be able to navigate focus to the disabled MenuItem in a Select.

Current Behavior

When focussing a select to activate the popper on a Select, the disabled MenuItem is still able to be selected.

Steps to Reproduce

Link: https://codesandbox.io/s/7yvj6qyy4j
ScreenCap: https://www.youtube.com/watch?v=T77Ue7Srr0s

  1. Use keyboard to navigate and highlight the select
  2. Open the select and chose a valid value to set the state and re-render the select with that value
  3. Use keyboard to navigate back to the select and open the popper and arrow-up to the disabled item (wont have any focus styles) and select it
  4. The Select is now the disabled value

Context

Just a bit confusing from an accessibility POV is all.

Your Environment

Tech Version
Material-UI v3.2.0
React 16.3.2
Browser Any
TypeScript
etc.
@oliviertassinari oliviertassinari added accessibility a11y component: menu This is the name of the generic UI component, not the React module! priority: important This change can make a difference labels Oct 31, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 31, 2018

This issue is linked to #10847. We need to rework the keyboard handling focus, the implementation is both incorrect and slow.

@oliviertassinari oliviertassinari changed the title MUI3.2.0 Select - disabled MenuItems still accessible via keyboard [Menu] Disabled MenuItems still accessible via keyboard Oct 31, 2018
@kylane
Copy link
Author

kylane commented Nov 1, 2018

Thanks @oliviertassinari

ryancogswell added a commit to ryancogswell/material-ui that referenced this issue Apr 18, 2019
* [MenuItem] Prevent setting tabIndex for disabled menu items (part of mui#13464)
ryancogswell added a commit to ryancogswell/material-ui that referenced this issue Apr 18, 2019
…s navigation (mui#13708 and mui#13464)

* [test] Improve maintainability of test scenario descriptions

* [ButtonBase] Use tabIndex of -2 for disabled

* [MenuItem] Use tabIndex of -2 for disabled

* [Divider] Use tabIndex of -2

* [MenuList] Skip tabIndex less than -1 in keyboard focus navigation
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! priority: important This change can make a difference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants