divi-accessibility
divi-accessibility copied to clipboard
Remove role="link" from anchor tags
The "ARIA support" option in the settings is useful, but I would advise you to remove the function that adds role="link"
to <a>
tags. I advise this for two reasons:
- Screen readers already know that an tag is a link because of HTML semantics.
- Sometimes components such as a tabbed interface use an tag as a tab so we need it to say role="tab" to avoid confusion/conflicts.
Supporting this! It gets flagged in our ADA review of Divi sites all the time.
Same. The attribute is redundant.
This may be a slightly different issue, but I'll leave it as a comment for now. Yesterday I found a social icon link in the footer with role="button"
. The ARIA roles seem off enough that I've had to turn off the setting that adds them.
I don't know exactly what has happened in the time, but since this issue has been opened on July 2021, and after that:
- on version 2.0.2 released on April 2022 the role="link" has apparently been added on links
- and since this is discouraged by MDN docs: ARIA: link role
Here:
Note: Where possible, it is recommended that you use a native [<a>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) element rather than the link role, as native elements are more widely supported by user agents and assistive technology. Native [<a>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) elements also support keyboard and focus requirements by default, without need for additional customization.
I advise to remove role="link" from <a>
tags since it is clearly redundant. Unfortunately, I see this very often around the web, for example in <main role="main">
or <nav role="navigation">
and I don't see why it would need to be specified two times.