Accessibility role on MenuItem should be on `a` inside the `li`
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Version
3.4.1
Environment
Chrome Version 65.0.3325.181 (Official Build) (64-bit) on OSX
Reproduction link
https://ant.design/components/menu/
Steps to reproduce
Use Chrome Developer tools to create an Accessibility Audit.
What is expected?
Should pass audit.
What is actually happening?
[aria-*] attributes do not match their roles.
According to this the role="menuitem"
should be on an a
element inside the li
instead of on the li
itself
https://www.w3.org/TR/2017/NOTE-wai-aria-practices-1.1-20171214/examples/menu-button/menu-button-links.html
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
ARIA: menuitem role - Accessibility - MDN Web Docs
The menuitem role indicates the element is an option in a set of choices contained by a menu or menubar.
Read more >ARIA role="menuitem" for <a> or <li> - Stack Overflow
When focus is in a menu and on a menuitem that has a submenu, opens the submenu and places focus on its first...
Read more >Navigation Menu Button Example | APG | WAI - W3C
The menuitem role is on the HTML a element contained by each li element so link behaviors are available when focus is set...
Read more >WAI-ARIA: Role=MenuItem - DigitalA11Y
Authors MUST ensure that menu items are owned by an element with role menu or menubar in order to identify that they are...
Read more >Creating Accessible Menus and Mega Menus - Level Access
All child roles of Menuitem, Menuitemcheckbox, or Menuitemradio must be focusable or referenced directly via aria-activedescendant from the focusable Menu or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cdeutsch I have two ongoing prs to address the issue. But please note that in the case of nav items like:
We leave it to the consumer for giving
role="menuitem"
:Note we need the
role={null}
part. The reason is mainly to keep convenient default aria-* value for MenuItem and to avoid introducing breaking changes.@yesmeck yes, it worked for me 👍