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

Keyboard accessibility of the main nav menu: focus and order #12022

Open
3 tasks done
pepelsbey opened this issue Oct 23, 2024 · 0 comments
Open
3 tasks done

Keyboard accessibility of the main nav menu: focus and order #12022

pepelsbey opened this issue Oct 23, 2024 · 0 comments
Labels
♿ a11y An MDN Web Docs accessible by everyone effort: medium This task is a medium effort. enhancement Improves an existing feature. frontend general frontend issues p2 We want to address this but may have other higher priority items. ux make the user experience awesome

Comments

@pepelsbey
Copy link
Member

pepelsbey commented Oct 23, 2024

Summary

When navigated via keyboard, the main nav’s focus order is not visual and breaks the expectations: not so bad on desktop, much worse on mobile. On mobile, the user menu is not even reachable.

URL

https://developer.mozilla.org/en-US/

Reproduction steps

  1. Go to https://developer.mozilla.org/en-US/
  2. Start tabbing through main navigation
  3. Try to open collapsed menu items

Expected behavior

  • All menu items available via keyboard
  • Menu items focused in visual order

Actual behavior

  • On mobile, the user menu is not reachable
  • Menu items focused in random order, especially on mobile

Device

Desktop

Browser

Chrome

Browser version

Stable

Operating system

Android

Screenshot

In every case, I tab through the opened menu and back. On mobile, I also press space on focused elements to open them.

mobile.mov
desktop.mov

Anything else?

I’d suggest using two different markup structures for desktop and mobile views and display: none one of them depending on the viewport size. Until we have the reading-flow property, the DOM order is the king for the keyboard navigation. You can also listen to matchMedia when the viewport changes and reorder DOM but it’s not a good idea.

Validations

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Oct 23, 2024
@github-actions github-actions bot added the idle label Nov 22, 2024
@argl argl added enhancement Improves an existing feature. p2 We want to address this but may have other higher priority items. ♿ a11y An MDN Web Docs accessible by everyone frontend general frontend issues ux make the user experience awesome effort: medium This task is a medium effort. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Dec 5, 2024
@github-actions github-actions bot removed the idle label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♿ a11y An MDN Web Docs accessible by everyone effort: medium This task is a medium effort. enhancement Improves an existing feature. frontend general frontend issues p2 We want to address this but may have other higher priority items. ux make the user experience awesome
Projects
None yet
Development

No branches or pull requests

2 participants