Unsupported role attribute used
Description
The Unsupported role attribute used
accessibility issue occurs when an HTML element has a role
attribute that is not recognized by assistive technologies (AT) like screen readers. The roleattribute is part of ARIA (Accessible Rich Internet Applications), which provides a way to make dynamic content and interactive elements accessible to users with disabilities.
When an unsupported role
is used, assistive technologies may not be able to interpret the element’s purpose or provide appropriate feedback to users, potentially leading to confusion or difficulty navigating the page.
Disabilities impacted
Visual impairments: users with visual impairments who rely on screen readers may encounter difficulties when encountering elements with unsupported roles:
- Screen readers may not be able to provide accurate information about the element’s purpose or functionality.
- Users may struggle to understand the structure and organization of the page.
Cognitive disabilities: individuals with cognitive disabilities might face challenges due to inconsistent or unexpected behavior:
- Unpredictable interactions can cause frustration and confusion.
- Users may find it difficult to understand the purpose of certain elements or navigate the page efficiently.
Motor impairments: while motor impairments are less directly impacted, users who rely on keyboard navigation or specialized input devices may experience difficulties:
- Elements with unsupported roles might not receive focus or behave as expected during keyboard navigation.
- Users may encounter unexpected behavior when interacting with elements using assistive technologies.
Why it matters
Ensuring that only supported roles are used is crucial for maintaining accessibility:
- It ensures that assistive technologies can accurately interpret and communicate the structure and functionality of web pages.
- Proper role usage helps create a consistent and predictable user experience for people with disabilities.
- Using supported roles contributes to meeting WCAG guidelines.
Coding problems and solutions
Common coding problems
Incorrect usage
Using a deprecated role
Using a role that doesn’t exist
How to Fix It
To resolve these issues, follow these best practices:
- Only use roles defined in the ARIA specification.
- Choose the most appropriate role for each element based on its purpose and functionality.
- Avoid inventing custom roles unless absolutely necessary and well-documented.
- Keep your knowledge of ARIA roles up-to-date, as some roles may become deprecated over time.
Corrected examples
Known Limitations
While using supported roles is crucial, there are some limitations to consider:
- New roles may be introduced in future ARIA specifications, which might not be immediately recognized by older assistive technologies.
- Complex images with multiple functions may require additional accessibility measures beyond simple
alt
text. - Some roles might be supported by certain browsers or screen readers but not others, potentially leading to inconsistent experiences across different platforms.
Resources
- Mozilla Developer Network (MDN): WAI-ARIA Roles
- ARIA Authoring Practices Guide (APG): Patterns | APG | WAI | W3C
- WCAG Success Criterion 4.1.2 Name, Role, Value: Understanding SC 4.1.2: Name, Role, Value (Level A)
Standard
- Standard: WCAG
- Rule ID:
unsupported-role-on-element