A navigation menu's keyboard handoff
A menu can look closed while its links still receive focus. It can open with a click and ignore Enter. It can dismiss on Escape and leave the visitor without a useful place to continue. A review that stops at the opening animation misses these different failures.
The useful unit of review is a handoff: the visitor reaches a control, opens the links, moves through them, then closes the panel or leaves it. At each transition, record what has focus and what the interface says is open. A screenshot of an expanded panel answers only part of that question.
Choose the interaction before the keys
The W3C Authoring Practices Guide has a disclosure-navigation example built around buttons and ordinary links. It explains that typical site navigation does not need the more elaborate ARIA menu widget. Its example supports Tab and Shift+Tab, button activation with Enter or Space, and Escape to close an open dropdown and return focus to its controlling button. Arrow-key navigation is optional in that example.
That is the pattern used for the small experiment here. A modal drawer has a different contract: the APG dialog pattern moves focus inside and contains its tab sequence until the dialog closes. Decide whether the rest of the page remains available before implementing either. The experiment does not test a modal drawer or supply a production navigation component.
Four examples with deliberately different defects
A local HTML fixture contained four labelled cases, using fictional navigation destinations. It had no forms, analytics or saved visitor data. The observations below were collected with browser keyboard actions and read-only DOM inspection in one desktop browser environment at 1280 by 720 pixels on November 3, 2026.
Case A used a native button. Its click handler toggled the panel's hidden property and the button's expanded state. Escape inside the panel hid it, set the expanded state to false and explicitly focused the trigger.
Case B left its links in the document and set the panel's opacity to zero. Its button still reported an expanded state. This was an intentionally inconsistent closed appearance, with both a visual concealment problem and a state-reporting problem.
Case C used a focusable div with a button role and a click listener. It deliberately omitted keyboard activation handling. Case D used a native button and correctly hid its panel on Escape, but deliberately omitted the focus-return call.
All four were educational fixtures. None was a customer site, an assessment of STEO's live navigation, or an accessibility certification. AI assistance was used to prepare the fixture, collect the observations and draft this explanation.
What the keyboard actually did
| Case and action | Observed result | What remains to investigate |
|---|---|---|
| A: Enter on the trigger | Panel opened; expanded state became true; focus stayed on the trigger | Whether the complete navigation path is understandable in the intended page |
| A: Tab, then Escape from the first link | Tab reached the link; Escape hid the panel and returned focus to the trigger | Other closing routes and other input environments |
| A: Space, Tab, Shift+Tab | Space opened the panel; Tab reached the first link; Shift+Tab returned to the trigger | Remaining links, reverse traversal and visible focus throughout |
| B: Tab from the trigger | The first link received focus even though its parent had opacity zero | How the production component hides and reports its closed state |
| C: Enter on the role-only trigger | Focus remained on the trigger and the panel stayed hidden | Missing keyboard activation behaviour |
| D: Escape from the first link | Panel became hidden; after the browser settled, focus was on the page body | An explicit and appropriate focus-return destination |
Case D also showed why observation timing belongs in the record. The immediate DOM read still named the now-hidden link as the active element. A later read, after a screenshot observation, named the body. There was no measured timing interval, and the experiment does not establish when another browser would update it. Neither reading showed focus deliberately returned to the trigger.
The evidence is narrower than a statement that a menu “works with the keyboard.” It records a sequence, the elements involved and the resulting states. Another implementation may move focus differently because it implements a different pattern. That difference needs an explanation in the review record.
Give each failure its own repair
Case A makes a useful reference because opening, traversing and closing were separately observable. The successful closing path had three parts: hide the controlled content, update the state on its trigger, and choose where the visitor continues. The close operation was more than changing the panel's appearance.
In Case B, the next useful question is where the invisible link sits in the keyboard sequence. Making the background darker or shortening an animation would leave that question unanswered. An engineer can inspect the mechanism that removes closed content from interaction, then repeat the same Tab action. The recorded state should also agree with the visible state.
Case C isolates a different problem. A pointer click is insufficient evidence for a control that visitors should operate with the keyboard. MDN describes the native button as an interactive element with built-in activation behaviour. The local comparison showed a native button responding to Enter and Space, while the role-only element did not respond to the tested Enter action. A visual resemblance and an announced role do not complete the behaviour.
Case D needs a destination decision. Returning to the opening control is the convention in the disclosure example, but a component that navigates to a new page needs to consider the resulting page instead. Write down the closing route being tested. Escape, following a link, clicking the trigger and crossing a responsive breakpoint are different events; one passing event does not cover the others.
Use a handoff worksheet during review
The worksheet below is an original review aid, not a list of additional WCAG requirements. Fill it from actual interaction with the page under review. Use short element names that another reviewer can find again.
| Moment | Record | A useful question |
|---|---|---|
| Before opening | Page address, viewport, focused trigger and reported state | Can the visitor locate the control without a pointer? |
| Immediately after opening | Visible panel, focused element and reported state | Does the result match the chosen disclosure or modal pattern? |
| While traversing | First and last links, forward and reverse sequence | Is there a predictable route through the revealed content? |
| On dismissal | Closing action, resulting focus and reported state | Can the visitor continue from a useful position? |
| After settling | Active element and any delayed visibility change | Did a transition undo the intended focus handoff? |
Attach an observation to each row instead of marking the whole component with one green tick. In Case B, “Tab focused Guide B while its container opacity was zero” is actionable. “Menu feels broken” requires someone else to reconstruct the problem before repairing it.
A compact bug report can include the starting address, the trigger's accessible name, the exact keys, the expected destination, the observed destination and a screenshot. Keep any test account or private page details out of a public report. For a public writing example, fictional labels and a local fixture are enough to explain the mechanism.
Keep the focus indicator in the review
W3C's Focus Visible guidance concerns knowing which element has keyboard focus. A DOM observation can name the active element while a visitor still cannot see it clearly. Record both the focused element and the visible indication. A screenshot should show the relevant control in context, rather than only a close crop of its border.
The local fixture used a contrasting outline for visible keyboard focus. That choice made it easier to inspect the demonstration; no contrast measurement or broader accessibility claim was made. On the real page, check the indicator against the actual background, including an open overlay and any animation that crosses it.
The Keyboard guidance supplies the broader requirement that functionality be operable through a keyboard interface, subject to its stated exception. The worksheet is one practical way to gather evidence for a navigation review. It does not replace reading the applicable requirements or testing the rest of the page.
Carry the evidence into a real release
First reproduce the defect on a saved version of the component. Keep the original address and interaction route in the record. After a targeted change, repeat those same keys and compare the results. Add nearby paths only when the repair could affect them, such as closing from the last link or switching from a wide navigation bar to a narrow disclosure.
Keep an unchanged working example beside the failing one when isolating a mechanism. The reference makes it easier to notice a new regression: a panel can regain a correct expanded state while losing its reverse keyboard route. Compare the recorded destinations as well as the appearance.
Finally, separate the browser evidence from the remaining work. This experiment did not involve a screen reader, multiple browser engines, touch input or zoom testing. The APG itself warns about support differences and the need for assistive-technology testing. A release record should identify those gaps plainly, alongside the paths that were actually checked.
For a related component with a visual rendering layer, Accessibility of canvas and WebGL content examines the HTML and control paths beside a canvas. The same review habit applies here: follow the visitor's next action through to its actual destination.
Questions and answers
Does ordinary website navigation need role menu?
Usually a disclosure containing ordinary links is a better starting point. The W3C APG navigation example explains why typical site navigation does not need the menu widget's more complex keyboard behaviour. Choose the interaction pattern before adding roles.
Why can an invisible link still receive keyboard focus?
In the controlled local example, setting the navigation container to opacity zero changed its appearance while its link remained reachable with Tab. Inspect focusability and the open state separately from visual appearance.
Does this experiment establish accessibility compliance?
No. It records specific keyboard actions and DOM states in one desktop browser environment. It does not include a screen reader, touch device, cross-browser study or full accessibility audit.
Sources
- Disclosure Navigation Example (W3C APG) w3.org
- Modal Dialog Pattern (W3C APG) w3.org
- The button element (MDN) developer.mozilla.org
- Understanding Focus Visible (W3C) w3.org
- Understanding Keyboard (W3C) w3.org