A listbox that contains a group of options is missing a role group on the grouped options
| Field | Value |
|---|---|
| Rule code | Manual_OptionGroup_Missing |
| WCAG conformance level | A |
| WCAG success criterion | 1.3.1 Info and Relationships |
| Must be fixed at source | No |
Description
When a listbox contains grouped options, they are often referred to as an 'option group.' An option group must contain at least one option and requires an accessible name, provided via either an aria-label or aria-labelledby attribute. We detected grouped options that did not reflect proper grouping in the HTML. Therefore, ensure that when options are part of a group, they are contained within an element with a group role. Without accessible grouping, the order and functionality of options may be unclear to users utilizing screen readers.
How to fix
Ensure that each container denoting a group of options has an accessible name provided via an aria-label or aria-labelledby attribute. Additionally, ensure that the group of options is contained within an element with a role of "group".