# Accessible Dropdown (Combobox): ARIA and Keys

Source: https://allyway.ai/glossary/accessible-combobox

An accessible dropdown (combobox) is an input or select control that opens a list of options and exposes its role, label, expanded state and current option to assistive technology, with full keyboard support. Custom comboboxes fall under WCAG 4.1.2 Name, Role, Value at Level A.

An accessible dropdown (combobox) is a field that opens a list of choices – a country picker, a search box with suggestions, a filter in a shop – and that works for everyone. Custom dropdowns from UI libraries often replace the native `<select>` with `div`s: they look modern, but the keyboard cannot open them, screen readers do not know the list exists, and the chosen value is never announced.

## What it means

The simplest accessible dropdown is the native `<select>` with a `<label>`. W3C notes that standard HTML controls already meet [WCAG 4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) (Level A) when they are used as the specification intends. Once you build your own, the criterion requires that its [name, role and value](https://allyway.ai/glossary/name-role-value) are programmatically determinable, that the value can be set, and that changes reach assistive technologies. W3C lists custom comboboxes explicitly as an example.

The [Combobox Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) of the ARIA Authoring Practices describes the parts:

| Part | Role and attributes |
|---|---|
| Input | `role="combobox"`, a visible label, `aria-expanded="false"` or `"true"` |
| Link to the popup | `aria-controls` with the ID of the list |
| Autocomplete behavior | `aria-autocomplete="none"`, `"list"` or `"both"` |
| Highlighted option | `aria-activedescendant` with the option's ID – keyboard focus stays in the input |
| Popup | `role="listbox"` with `role="option"` children; the chosen option gets `aria-selected="true"` |

The popup can also be a grid, tree or dialog; `aria-haspopup` is `listbox` by default and is set only for those other types.

| Key | What happens |
|---|---|
| Down Arrow | Opens the list if needed and moves into it |
| Alt + Down Arrow (optional) | Opens the list without moving focus |
| Up Arrow (optional) | Moves to the last option |
| Enter | Accepts the highlighted option |
| Escape | Closes the list; optionally clears the field if the list was already closed |

> **Warning:** > **Don't break typing**
> A combobox with a text input must not capture keys that people use to edit text, such as Home, End or Left and Right Arrow inside the field. W3C warns that scripts interfering with native editing keys make the field harder to use.

## Examples

```html title="Example"
<label for="country">Country</label>
<input id="country" type="text" role="combobox"
       aria-autocomplete="list" aria-expanded="true"
       aria-controls="country-list"
       aria-activedescendant="opt-at">
<ul id="country-list" role="listbox" aria-label="Countries">
  <li id="opt-at" role="option" aria-selected="true">Austria</li>
  <li id="opt-de" role="option" aria-selected="false">Germany</li>
  <li id="opt-ch" role="option" aria-selected="false">Switzerland</li>
</ul>
```

The [form label](https://allyway.ai/glossary/form-labels) gives the field its name. While the user presses the arrow keys, the script moves `aria-activedescendant` from option to option, so a screen reader announces "Austria, 1 of 3" without moving focus out of the input. When the list closes, `aria-expanded` returns to `false`.

**Do:** Do

Use a native `<select>` when people only pick from a short list, give every combobox a visible label, keep `aria-expanded` and `aria-activedescendant` up to date, and let Escape close the list.

**Don't:** Don't

Replace `<select>` with a `div` that opens only on click, use a menu button to show a selected value, rely on the placeholder as the only label, or move keyboard focus into the list in a way that stops people from typing.

## How to check an accessible dropdown (combobox)



## Questions

Q: How do you make a dropdown accessible?
A: Start with a native `<select>` and a `<label>`. If you need search or suggestions, build a combobox: `role="combobox"` on the input, `aria-expanded`, `aria-controls` to a `listbox`, `aria-activedescendant` for the highlighted option and full arrow-key support.

Q: Is a native select accessible?
A: Yes. Standard HTML controls meet WCAG 4.1.2 when used as specified, and browsers handle keyboard and screen reader support for `<select>`. Its main limits are styling and the lack of a search field.

Q: What is the difference between a combobox and a listbox?
A: A listbox is a list of options that is always visible. A combobox is an input that controls a popup – usually a listbox – which opens and closes.

Q: Should focus move into the dropdown list?
A: In the W3C pattern for a listbox popup, DOM focus stays on the input and `aria-activedescendant` points to the highlighted option. That way people can keep typing while they browse the suggestions.

Q: Are dropdown menus and comboboxes the same?
A: No. A menu button opens a list of actions, a combobox lets people pick or type a value. W3C points out that menu buttons cannot be marked required and have no value, so they are the wrong choice for form fields in [accessible forms](https://allyway.ai/glossary/accessible-forms).
