-
Notifications
You must be signed in to change notification settings - Fork 37
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
Revisit accessibility of main nav menu #137
Comments
Dropdowns accessibility updates, resolves #137
(didn't realize Github would auto-close this) Hi Terrill, I've addressed most of this in the most recent pull request. I'm satisfied with how it functions for now, but the following needs to be revisited:
There's some UX issues with overriding default functionality (i.e. don't undo a hover-state if your mouse is still actually hovering, etc.) but I think we can come to a happy medium with additional testing. Thank you for your guidance in resolving these accessibility issues. It was extremely helpful and a huge improvement to the navigation. |
After a round of bug fixes I am marking this as resolved. We're noting the guidance on using buttons vs links for the main navigation and keep it in mind for future development. |
I discovered some additional bugs with keyboard interaction, hopefully easy to fix:
|
Specific steps for reproducing the latest issues (it's the same in all browsers, confirmed in Firefox on Mac OS and Chrome in both Mac OS and Windows): Issue 1: Right/Left arrows not working when submenu is collapsed
Issues 2-3: Up/Down arrows not moving to the correct target after jumping with a letter in submenu
What seems to be happening is the pointer to the user's current location in the menu does not change when the user jumps to a new item by pressing a letter. For example, if the user's focus is on the second item in the menu, then they jump somewhere else (e.g., by pressing "C"), the pointer remains on the second item. So when the user presses up arrow, they move to the first item in the menu, rather than the item immediately before their new location. The down arrow behaves the same way. |
Some new accessibility bugs seem to have slipped into the dawgdrop menus, as observed in the new theme on both the Admissions and CISO websites. Here's an up-to-date list of problems and solutions:
|
Hi Terrill, Noting this is related to the new theme and adding it to our list. |
The main "Dawgdrops" navigation menu was build with accessibility in mind, but accessibility methods related to navigation menus have evolved since then. The current menu needs the following changes, which I've grouped into two phases:
Phase 1
The following changes don't require any changes to HTML structure of the menu; therefore should be fairly easy to make I think.
role="application"
from div.dawgdrops-inneraria-haspopup="true"
from each top-level menu item (<a>
)role="group"
andaria-expanded
from the<ul>
that contains each submenu<nav>
, all open submenus should close, regardless of whether they were opened using the keyboard or mouse. (Currently, if a submenu was opened with a mouse, it's impossible to close it with the keyboard).aria-expanded
attribute on the top-level menu item should change to "true". Conversely, when the submenu closes, thearia-expanded
attribute should change to "false". This change should occur regardless of whether the submenu was opened/closed with keyboard or mouse (currently the attribute value only changes on keyboard events).Phase 2
Currently, the top-level menu item is serving two roles. It serves the role of a link (
<a>
) that leads to a new page, but also as a button that triggers the submenu. This isn't allowed in HTML, and there are only two ways to solve it:<button>
elements, so they serve the button role, but no longer link to other pages, or<button>
, adjacent to the link. There's already a visual indicator to the right of each link, so this could be accomplished with little or no change to the visual design. That visual indicator just needs to be a<button>
.I've been told in the past that option 1 is not an option: Those top-level links are not expendable. If that's still true, option 2 would be the one to implement. The following additional steps assume there is both a link and a button for each top-level menu item:
aria-expanded
andaria-controls
attributes from the link to the button.aria-labelledby
to the button, with a value that matches theid
of the link (e.g.,aria-labelledby="academics"
).The text was updated successfully, but these errors were encountered: