Skip to content
easeweb
Search topics

Action menus that open silently, out of keyboard reach

An Actions button drops down a menu of clickable divs, but says nothing about the menu, leaves focus on the button, and gives the actions no role, no Tab stop and no arrow keys, so a keyboard can't reach them and a screen reader isn't told anything opened.

WCAG 2.2
SC 2.1.1ASC 4.1.2A
Required by
Section 508 · EN 301 549 (EU)
Broken <div class="item">Download invoice</div>
The accessibility problem illustrated: Motor:How do I get into the menu?
01

The problem

Keyboard users can open the Actions menu but can't reach anything in it, and screen reader users aren't told that the button opens a menu or that one has opened.

02

Try it

Open Actions and reach Download invoice using only the keyboard.

  • Broken 1: Tab to Actions and press Enter. The menu opens, but focus stays on the button, the panel below says nothing new, and the next Tab passes the menu by.

  • Broken 2: the same divs, with menu roles added. The panel now says the button opens a menu, but Enter still leaves focus behind, and neither Tab nor the arrow keys reach an item.

  • Apply the fix. In the menu button, Enter moves focus to the first action, and the arrow keys, Home, End and Escape work; in the disclosure, the next Tab goes from Actions into the list.

Broken Can you fix this?

Order 1042

Delivered on 14 October

View all orders

Screen reader says:

(Tab to Actions)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Make the button say that it opens something and whether it is open, and put every action where the keyboard reaches it: in a menu that takes focus and the arrow keys, or in plain buttons straight after the button.

  1. 1The button says that it opens a menu, or whether it is expanded, and says it again as it opens and closes.
  2. 2Every action is a button, a link or a menu item that the keyboard can reach.
  3. 3A role="menu" gets everything the role promises: focus moves in, the arrow keys move, Escape goes back; without them, use plain buttons.
Before

A button and a dropdown of clickable divs

<article class="order">  <h2>Order 1042</h2>  <p>Delivered on 14 October</p>  <div class="actions">    <button type="button" class="actions-button">Actions</button>    <div class="actions-menu" hidden>      <div class="item" data-action="buy-again">Buy again</div>      <div class="item" data-action="return">Return items</div>      <div class="item" data-action="invoice">Download invoice</div>      <div class="item" data-action="report">Report a problem</div>    </div>  </div></article>
After

A menu button

<article class="order">  <h2>Order 1042</h2>  <p>Delivered on 14 October</p>  <div class="actions">    <button type="button" class="actions-button" id="order-1042-actions" aria-haspopup="menu" aria-expanded="false" aria-controls="order-1042-menu">Actions</button>    <div class="actions-menu" id="order-1042-menu" role="menu" aria-labelledby="order-1042-actions" hidden>      <button type="button" role="menuitem" tabindex="-1" data-action="buy-again">Buy again</button>      <button type="button" role="menuitem" tabindex="-1" data-action="return">Return items</button>      <button type="button" role="menuitem" tabindex="-1" data-action="invoice">Download invoice</button>      <button type="button" role="menuitem" tabindex="-1" data-action="report">Report a problem</button>    </div>  </div></article>

04

Verify the fix

5 checks, no mouse.

Test with: Keyboard, Screen reader, Forced colors, Zoom

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the menu, its component or its library changes.

How screen readers handle aria-expanded and aria-haspopup="menu"

Limits

This is a starting pattern, not a guarantee for every application. The scripts are minimal sketches: one menu per page, no type-ahead, no unavailable items, no submenus. A drop-down of links across the top of a site is navigation, a different pattern, covered in hover-only dropdowns, or ones that never say they are open; a drop-down that picks a value, such as a size, is a select, covered in custom dropdowns that keyboards and screen readers can't use. Menus that only a right-click or a long press opens are covered in right-click, long-press and swipe actions with no button, and a button that is only an icon, such as three dots, also needs a name, as icon-only buttons with no accessible name explains. Test the complete journey with your target assistive technology.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

Keep this fixed as your code changes.

Turn guides like this into rules your coding agents and CI follow, then have the result retested with a keyboard and screen readers.

How retests work