A listbox element is missing a required child element of option
| Field | Value |
|---|---|
| Rule code | Manual_Listbox_ChildRequirement_Missing |
| WCAG conformance level | A |
| WCAG success criterion | 4.1.2 Name, Role, Value |
| Must be fixed at source | No |
Description
A listbox is a widget that allows the user to select one or more items from a list of choices. A listbox element was found to be missing required nested option elements. A listbox requires one or more nested options and requires that all selected options have the aria-selected attribute set to true. If an option is not selectable, you can omit the aria-selected attribute. Without elements that have a role of option inside listboxes, assistive technologies such as screen readers cannot convey the purpose or structure of the listbox to users, leading to incomplete or incorrect interpretation. This can cause confusion and navigation issues for users relying on assistive technologies. More details: https://www.w3.org/TR/wai-aria-1.1/#listbox.
How to fix
Ensure each listbox element (e.g., <div role='listbox'>) contains at least one element with a role of 'option'. (e.g., <div role='listbox'><p role='option'>Option 1</p></div>).