Search topics
Custom dropdowns that keyboards and screen readers can't use
A dropdown rebuilt from divs takes only clicks and has a label nothing points to, so keyboards can't choose and screen readers hear no label or options.
<div class="select" tabindex="0"> The problem
Keyboard users can't open the dropdown or pick an option, and screen reader users never hear the "Size" label shown above it, a role, the current value or the options, so they can't tell what they are choosing
A shop's product page has a Size dropdown above the Add to basket button. It shows "Choose a size" in a rounded box with a chevron, and a click opens a list: Small, Medium, Large, Extra large. Someone using a keyboard meets one of two builds. In the first, Tab jumps straight from the product name to Add to basket: the dropdown never takes focus, so no size can be chosen, and the basket refuses the item. In the second, the dropdown does take focus, Enter opens it, and the arrow keys move a highlight through the sizes. A screen reader, though, says only "Choose a size", with no role and no hint that it opens, reads nothing as the highlight moves, and after Enter still says nothing about which size was chosen. The word "Size" printed above the box is never read with it either. Before a size is picked, the box's own text hints at what it is for; once one is, a screen reader returning to the box says just "Medium", with nothing to say what Medium is.
Success Criterion 2.1.1 asks that everything a mouse can do can be done with a keyboard. In the first build, the trigger is a div with a click handler: it can't take focus and no key reaches it or its options. Success Criterion 4.1.2 asks that a control's name, role and value, and any state the user can change, are available to assistive technology. In the second build, the keyboard works, but the element has no role, its name is whatever text it shows, the open list is not exposed as open, and the highlight is a CSS class. The browser has nothing to pass on, so a screen reader user can operate the control only by guessing.
Success Criterion 1.3.1 asks that relationships shown on screen are also there in the code. In both builds, "Size" sits right above the box, so the eye pairs them, but it is a span that nothing points to: there is no label for and no aria-labelledby. The browser names a control only from what the markup ties to it, and a span that merely sits nearby ties nothing, so the label exists only on screen. HTML doesn't object, because a span beside a div is valid markup, and a label element couldn't name the div anyway: for works only on form controls such as select and input.
Dropdowns are often the step that must be done before anything else, such as a size, a delivery country or a time slot, so a dropdown that can't be used stops the whole task. On a phone, a native select opens the system picker with large rows; a rebuilt one gives up that picker too.
4 of 10 groups affected
- No vision (affected)
- Low vision (affected)
- Colour vision (not affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (affected)
- Reach, strength (not affected)
- Cognitive (affected)
- Seizures (not affected)
- Limited manipulation Keyboard and switch users can't open the list, or move through it without knowing what Enter will pick, so a required choice such as a size blocks the whole form.
- Without vision Screen reader users hear the trigger's text without the "Size" label, a role or a value, and nothing as the highlight moves, so they can't tell it is a choice, what it is for, what is chosen, or what else there is.
- Limited vision People with low vision who find the pointer hard to track can't open the dropdown from the keyboard instead, and a screen reader used alongside magnification gives them no role or value to confirm what is chosen.
- Limited language, cognitive and learning abilities A control that looks like a dropdown but ignores the keys a dropdown takes is confusing, and the person may not notice that no size was set.
A scan sees a div with some text and a ul of li elements. With no role or ARIA, nothing in the markup breaks a rule a scanner knows, and the list is hidden until a click. A scan that checks only for tabindex passes the second build. Nor can a scan tell that the "Size" span belongs to the dropdown: a div with no role isn't a control it expects to have a name. AI assistants asked for "a styled dropdown" often write exactly these two builds, or add role="listbox" to the list but leave the trigger without a role, value or aria-activedescendant, which still leaves the highlight silent. Only tabbing, opening, arrowing and listening shows whether it works.
What the checkers report
- axe DevTools
- Required ARIA attributes must be provided
- Select element must have an accessible name
- Lighthouse
[role]s do not have all required[aria-*]attributes- Select elements do not have associated label elements.
Try it
Choose a size with the keyboard alone
Broken 1: press Tab to reach Size. You can’t: Tab skips Size, which is the failure. Try clicking it instead. The panel shows what a screen reader says as you move and pick.
Broken 2: Tab to Size, press Enter to open it, the down arrow, then Enter. Can you choose a size without the mouse? After picking, Tab on and Shift + Tab back: the box is read as just the size, and the label “Size” is never read.
Apply a fix. Choose a size with the keyboard again, then Tab on and Shift + Tab back: is the label “Size” read now?
Broken Can you fix this?
Everyday cotton T-shirt
- Small
- Medium
- Large
- Extra large
The fix
Use a native select, or a combobox that behaves like one
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>What is wrong3 points
- Nothing in the dropdown can take focus: the trigger and the options are a
divand list items with click handlers. - Keyboard users can't choose a size: Tab skips the dropdown, and no key opens it.
- "Size" is never read as the dropdown's name: the span is only placed above the box, not tied to it.
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>How it is fixed5 steps
- Replace the dropdown with a
selectand its options. The browser makes it a Tab stop, opens it with the keys each platform expects, moves through the options with the arrows and by typing a letter, and tells a screen reader its name, its role, its value and each option. On a phone it opens the system picker. - Make "Size" a
labelwhoseformatches the select'sid, so it is tied to the select in code and read as its name. Clicking the label also focuses the select. - Restyle only the closed box: remove the browser's look with
appearance: none, and draw your own border. - Draw the chevron in
currentColoron the wrapper, so it follows the text in forced colors. - Draw the focus ring with
outlineon:focus-visible.
This fixes both Befores and passes 2.1.1, 4.1.2 and 1.3.1. The border, the chevron and the focus ring are yours to draw, and all three survive forced colors. Of the extras a select is often rebuilt for, appearance: base-select lets a native select style its open list and show a swatch or a note in each option too, in Chrome and Edge from version 135 and Safari from 27, in October 2026 (Firefox only behind a flag); other browsers show the ordinary select.
Why this fix: Use native HTML first
Both pass 2.1.1, 4.1.2 and 1.3.1. Use the native select: it does the same job with no script, and the browser gives every device its own keys, its own picker and its own announcements, which no rebuild matches. Build the ARIA combobox only when an option has to show something a select can't, such as a colour swatch or a stock note beside the size, and accept that its keys, states and touch behaviour are yours to test and maintain.
Styling only the closed box covers most designs: the open list is drawn by the system, which suits phones and screen magnifiers. Chrome, Edge and Safari 27 also let the open list be styled with appearance: base-select (October 2026), so a native select can show richer options while other browsers fall back to the ordinary select. Treat that as an enhancement, and test the fallback.
Keep a visible label beside the dropdown, and tie it in: label for on a select, aria-labelledby on a combobox. Don't let aria-label replace it with different words, or the name read aloud stops matching what is on screen. A placeholder option such as "Choose a size" is the value until something is picked, not the name; with a select, give it value="" and make the field required if a size must be chosen.
Hiding a native select and drawing a rebuilt one over it, as some older jQuery plugins do, gives you both problems: the real select is out of reach, and the drawn one is one of the Befores. Check component libraries by tabbing, opening, arrowing and listening, as in the steps below, before trusting their documentation. Choosing an option must not submit the form or load another page by itself; see dropdowns and fields that change the page on their own. When people type to filter a long list instead, see autocomplete fields with silent, mouse-only suggestions.
Verify the fix
5 checks, no mouse.
Test with: Keyboard, Screen reader, Zoom, Forced colors
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.
How screen readers handle aria-expanded
Limits
This is a starting pattern for a single-choice dropdown. It doesn't cover grouped options or a list loaded from a server as the person scrolls; choosing several options is covered in multi-selects whose ticks are never read out. 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.
References
- WCAG Understanding: keyboard (opens in a new tab)
- WCAG Understanding: name-role-value (opens in a new tab)
- WCAG Understanding: info-and-relationships (opens in a new tab)
- ARIA APG: combobox-select-only (opens in a new tab)
- developer.mozilla.org: select (opens in a new tab)
- developer.mozilla.org: Customizable_select (opens in a new tab)
EaseWeb service
Fixed it? Keep it from coming back.
I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.