composite-without-required-children
Composite UI widgets must contain at least one element with a role belonging to its "Allowed Accessibility Child” Roles.
Description
Composite elements (i.e., components that require a structure composed of different elements that make up one interface component) often require a specific parent-child structure or relationship so assistive technologies can parse and announce them correctly, and users can operate them. In this case, the detected element's role is of a container that manages other contained widgets. As such, its actionable descendants must have a specific role that none of its children have.
Quick Fixes
The role of the actionable items depends on their container's role.
Below is a list of all the roles that require actionable descendants with a specific role. Some "container roles" allow more than one type of role for their actionable items, but the choice is from a limited list of allowed roles.
Note that certain roles require additional elements to the general structure, and the actionable elements should not necessarily be direct children of the detected element (like in role="grid", for example).
| Container’s role | Required actionable items role/s |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| grid | columnheader, gridcell, rowheader |
| listbox | option |
| menu, menubar | menuitem, menuitemcheckbox, menuitemradio |
| radiogroup | radio |
| tablist | tab |
| tree | treeitem |
| treegrid | columnheader, gridcell, rowheader |
How Users Are Affected
Assistive technology users and, in particular, screen reader users may receive partial or incorrect information about the element and, therefore, may have difficulty understanding the content of the component and operating it.
WCAG Success criteria
This issue might cause elements to fail one or more of the following Success criteria:
1.3.1 Info and relationships (A) | 4.1.2 name, role, value (A)