Skip to main content

aria-roledescription

Ensure that elements marked for removal from the accessibility tree are indeed removed.

Severity: Serious

Description

The usage of the aria-roledescription attribute should be limited to elements that have either an implicit or explicit role. The aria-roledescription property provides authors with the ability to customize how assistive technologies localize and announce the name associated with an element’s role. It is important to note that the purpose of the aria-roledescription attribute is not to alter the element’s semantics, but rather to specify its existing semantics.

Why is it important?

Elements with conflicting role names can cause confusion for users and hinder their ability to utilize them effectively. Even if an element has an aria-roledescription attribute, an assistive technology may not announce it if the element is semantically neutral. This can lead to people using assistive technologies being unaware of the existence of such elements. Inappropriate values assigned to the aria-roledescription attribute, which conflict with an element’s implied or explicit role, can negatively impact the accessibility of a web page. Such conflicting values may not have any effect on the accessibility of the application and can potentially disable accessibility for entire sections of the application.

Examples

  • Success:

    • aria-roledescription is correctly reported by assistive technologies for elements with an implicitly or explicitly supported role.
  • Failure:

    • Assistive technologies do not report the aria-roledescription attribute applied to a semantically neutral element - <span>

How to fix?

Use aria-roledescription only when an elements has-

  1. Implict ARIA role - <button> and <img> are examples of elements with implict ARIA roles.
  2. Explicit ARIA role - The role attribute is used to add an explicit role.

Tags

cat.aria, wcag2a, wcag412

References

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy