-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Bug(navbar): languages and doc version drop downs are inaccessible via the keyboard and screen reader #8478
Comments
It may be a little unexpected, but dropdowns are expanded with Enter, not Tab. This is because dropdowns can get long, and we don't want tab navigation to get stuck in a dropdown. |
@Josh-Cena That makes sense, but the menus do not expand with |
It is not the case for me, the dropdown should expand (with enter), can you double-check? CleanShot.2022-12-23.at.11.55.39.mp4Which browser/OS to reproduce? |
The drop down works without the screen reader enabled but does not work if NVDA screen reader is enabled. I am on Windows 11, Edge 108 |
I run into the same issue if I try to access the menus with the Windows narrator turned on. |
Do NVDA or Windows narrator prevent pressing enter somehow? Are other users of these tools experiencing the same problem? cc @timveld @BenDMyers maybe you can help us figure this out? |
The issue is not actionable until someone else with the same setup can confirm. Awaiting more information on this. |
@Josh-Cena I can reproduce with NVDA, it's because NVDA will trigger the So in the docusaurus/packages/docusaurus-theme-classic/src/theme/NavbarItem/DropdownNavbarItem.tsx Lines 87 to 102 in 1293970
The things to improve in the component in my opinion, I can make a PR: Button instead of link and remove the role attributeARIA roles just change the way elements are exposed to assistive technologies, it will not add any behavior, for example, you can trigger a button with the SPACE key, this is not the case with the current navbar button. Great article about this: https://www.erikkroes.nl/blog/aria-roles-do-very-little/ Windows High Contrast Mode also doesn't care about ARIA roles, so the navbar buttons will appear as links for users of this assistive technology. I guess it was done with an anchor to make it work without JS, but it's not working with a keyboard interface if you remove JS. I think we don't really have a choice to use a button here to make it better. The new Popover attribute will be nice, but not yet well supported Remove aria-haspopup
A https://w3c.github.io/aria/#menu
|
Hello, I ran into this problem while checking accessibility for our docusaurus website. Would it be possible to review @srapilly 's PR and get this merged? |
@natedx I will try to take a look soon but I don't have great accessibility skills and it's always hard to spend hours trying to figure out if things are accessible, and annoying to merge PRs blindly trusting the author things are an improvement. I also don't have all the OS and software on my computer to test changes are safe for all assistive setups 😅 And I barely know how to use assistive software either. Can you help review the PR? Usually, if I see a few blind/disabled people mentioning that the new behavior is an improvement, I'm more likely to review/merge the PR faster. |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
The languages and docs version drop-down menus are not accessible via the keyboard. This violates WCAG 2.1.1 which states that all functionalities on the website must be accessible via the keyboard. Drop-down menus don't fall under the exceptions of freehand drawing, or a game intended to teach a specific movement.
https://www.w3.org/WAI/WCAG21/Understanding/keyboard.html
https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Operable
Reproducible demo
No response
Steps to reproduce
Inaccessible.drop-down.menu.demo.mp4
Expected behavior
I thought the menus would open automatically as I tabbed to them giving me the option to choose the doc version and language with the arrow keys and enter key. I also expect to be able to close the menu by pressing tab again.
Actual behavior
I am unable to activate the menus at all with the keyboard.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: