listbox-name-present

Listboxes have an accessible name

automaticWCAG 4.1.2 (A)confidence: highseverity: seriousrobust

Checks that elements with role="listbox" expose a non-empty accessible name.

Applies to. Applies to elements carrying role="listbox" (the attribute must name that role alone, not a fallback list) that are included in the accessibility tree. An element with the matching implicit role but no role attribute is out of scope.

Expectation. The element has a non-empty accessible name from aria-label, from an aria-labelledby that resolves to non-empty text, or from title. role="listbox" is name-from-author-only, so subtree text is never accepted: text sitting inside a custom listbox widget is not reliably exposed as its name. On a labelable element (<select multiple role="listbox">) an associated <label> counts as well.

Examples

pass
<ul role="listbox" tabindex="0" aria-label="Fruit"></ul>

`aria-label` names the listbox.

fail
<ul role="listbox" tabindex="0"></ul>

No accessible name from any supported mechanism.

View source