Skip to content
easeweb
Search topics

Custom dropdowns that a keyboard can't open or read

A dropdown rebuilt from divs and list items to match the design takes clicks only, or moves a highlight drawn by a class, so keyboard users can't choose and screen readers never hear a role, a value or the options.

WCAG 2.2
SC 2.1.1ASC 4.1.2ASC 1.3.1A
Required by
Section 508 · EN 301 549 (EU)
Broken <div class="select" tabindex="0">
The accessibility problem illustrated: Medium is highlighted, and nothing says so.
01

The problem

Keyboard users can't open the dropdown or pick an option, and screen reader users hear no role, no current value and no options, so they can't tell what they are choosing.

02

Try it

Try to choose a size with the keyboard: Tab to Size, Enter to open, the down arrow, then Enter.

Can you choose a size without the mouse? In Broken 1 you can’t even reach it: Tab skips Size, which is the failure. Try clicking it instead, then switch to Broken 2. The panel shows what a screen reader says as you move and pick.

Broken Can you fix this?

Everyday cotton T-shirt

Size
Choose a size

Screen reader says:

(Tab to Size)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Make the dropdown a native select, or a combobox whose role, value and highlighted option reach assistive technology and whose keys work like a select's.

  1. 1Tab reaches the closed dropdown, and its name, role and value are read.
  2. 2The keys a select takes open it, move through the options and pick one.
  3. 3The highlighted option is exposed in code, not only drawn.
Before

A dropdown only a click can open

<span id="size-label">Size</span><div class="select">  <div class="select-trigger">Choose a size</div>  <ul class="select-options" hidden>    <li>Small</li>    <li>Medium</li>    <li>Large</li>    <li>Extra large</li>  </ul></div>
After

A native select with a styled box

<label for="size">Size</label><span class="select-box">  <select id="size" name="size">    <option value="">Choose a size</option>    <option value="s">Small</option>    <option value="m">Medium</option>    <option value="l">Large</option>    <option value="xl">Extra large</option>  </select></span>

Why this fix: Use native HTML first

Fixing this with an AI coding assistant? Get this guide as Markdown

04

Verify the fix

5 checks, no mouse.

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

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 shared dropdown component changes.

Limits

This is a starting pattern for a single-choice dropdown. It doesn't cover choosing several options, grouped options, or a list loaded from a server as the person scrolls. Test the complete journey, with your real options, in the browsers and assistive technology you support.

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