aria-required-children
Certain ARIA roles must contain particular children
Description
Sometimes it is necessary to use non-semantic elements to extend semantics that do not exist naturally in HTML or other constraints. Elements that have an ARIA role that requires specific owned elements such as list, table, row etc., should contain at least one instance of its required owned element.
For example, an element that has a role="list"
, MUST contain at least one element with role="listitem"
. There may be cases that the "required owned elements" are "currently not present", for example, while editing or while loading data. When a widget is missing, required owned elements due to script execution or loading, the containing element should be marked with aria-busy="true"
until the "required owned elements" are filled.
Quick Fixes
1✗ <div role="list">2 <div><!-- div content --></div>3 <div><!-- div content --></div>4 <div><!-- div content --></div>5 </div>67✓ <div role="list">8 <div role="listitem"><!-- List item content --></div>9 <div role="listitem"><!-- List item content --></div>10 <div role="listitem"><!-- List item content --></div>11 </div>1213✓ <div role="list">14 <div role="listitem"><!-- List item content --></div>15 <div><!-- div content --></div>16 <div><!-- div content --></div>17 </div>18
1✓ <div role="list" aria-busy="true">2 <!-- Content Is Loading -->3 </div>4
How Users Are Affected
When a screen reader fails to parse the semantic meaning of UI elements, it cannot mediate it correctly to the user. As a result, the user receives a partial or even incorrect mental image of the UI and might fail to use 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)