aria-allowed-role
ARIA role must be appropriate for the element
Description
The purpose of ARIA roles is to enhance the "natural" HTML semantics.
They are supposed to complete semantic UI concepts that are not part of the core language.
Each role property can receive one of 70 optional values.
Some represent a whole concept (like a header [banner], or a footer [contentinfo]),
and some represent a component in a larger structure (for example, a menuitem within a menu element or an option within a selectbox).
However, these 70 potential values are the only valid values for the "role" attribute.
These are the valid values to use with the role attribute:
buttoncheckboxgridcelllinkmenuitemmenuitemcheckboxmenuitemradiooptionprogressbarradioscrollbarsearchboxseparatorsliderspinbuttonswitchtabtabpaneltextboxtreeitemcomboboxgridlistboxmenumenubarradiogrouptablisttreetreegridapplicationarticlecellcolumnheaderdefinitiondirectorydocumentfeedfiguregroupheadingimglistlistitemmathnonenotepresentationrowrowgrouprowheadertabletermtoolbartooltipbannercomplementarycontentinfoformmainnavigationregionsearchalertlogmarqueestatustimeralertdialogdialog
Quick Fixes
Ensure that all the role properties have a valid value (from the listed above). Notes:
- Please take into account that some role values require to be part of a particular semantic structure (i.e., it will have parent/child elements with a specific role)
- In case that none of the roles above fulfill the semantics that you are looking for,
and the missing semantics is essential for the understanding of the content, you can try looking at the
aria-roledescriptionproperty.
How Users Are Affected
Assistive technologies usually ignore invalid role values, so their users might not perceive the whole meaning or purpose of the elements they are assigned to.
WCAG Success criteria
This issue might cause elements to fail one or more of the following Success criteria:
4.1.2 Name, role, value (A)
Recommended Reading
- The Treachery Of HTML Elements, Evinced blog