-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Made menubar with nested dropdowns keyboard accessible based on W3's menubar design pattern #35462
Conversation
AFAIK the ARIA menu design pattern is not meant to be used for standard website navigation, is it? @patrickhlauke any argument on whether we should implement this or not? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have unrelated changes in the PR, please drop them
@ffoodd correct, ARIA menu bar patterns are generally meant for application-like menus, not for navigation menus. The use of an ARIA menu for site navigation has long been a controversial topic. Most recent active discussion can be found here w3c/aria-practices#353. The general consensus among most practitioners today is that ARIA menus should really only be used for "application-like" menus (in web applications that mimic apps, and have menus that trigger commands like Copy/Paste/etc. (however, that ARIA Practices example for navigation continues to persist in version 1.2, much to the chagrin of many people involved). Note that for a proper ARIA menu implementation, you'd also need all the relevant In any case, I think we'd pass on this. We used to have a basic part of ARIA menu stuff in Bootstrap years ago, but we removed it because it's not universal/generic enough - we know that authors use bootstrap's dropdowns for things that are simply not ARIA menus (a real ARIA menu only allows you to have menu items, menu radio button items, menu checkbox items, and submenus - as soon as you put in anything else, like a search box or even just a bit of static text, you are unable to express that correctly with ARIA roles since that simply won't translate to correct/sensible structures in the accessibility tree that browsers pass on to assistive technologies). I'd suggest not merging this, but an idea may be for the author to release this as some sort of extension/plugin that others can use when/if their menus do fit the pattern. |
Thanks for weighing in! The menubar I worked on did follow the rest of the ARIA guidelines in the pattern such as the "role=" property and providing some sample html probably would have helped. That's interesting this pattern is non-standard for a nav, I had no idea when I found the documentation and implemented it. Following the pattern did allow the nav on the website I was working on to pass a third party accessibility certification (dropdowns and sub-dropdowns had to be fully keyboard accessible) but maybe a simpler pattern would have worked as well. I'll go ahead and close this PR and consider creating an extension that fits this particular use case. |
Made it so a menubar with nested dropdowns will be keyboard accessible according to W3's menubar design pattern: https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html
I'm guessing my changes may not fit the existing code gracefully (this was created for a specific menubar for a project and I'm not that familiar with this codebase) but I'm interested in hearing what others think about adding these accessibility features to the existing dropdown code.