Keyboard accessibility of the main nav menu: focus and order #12022
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
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
Expected behavior
Actual behavior
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 thereading-flow
property, the DOM order is the king for the keyboard navigation. You can also listen tomatchMedia
when the viewport changes and reorder DOM but it’s not a good idea.Validations
The text was updated successfully, but these errors were encountered: