divi-accessibility icon indicating copy to clipboard operation
divi-accessibility copied to clipboard

Remove role="link" from anchor tags

Open MattWilsonMD opened this issue 3 years ago • 4 comments

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:

  1. Screen readers already know that an tag is a link because of HTML semantics.
  2. 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.

MattWilsonMD avatar Jul 27 '21 21:07 MattWilsonMD

Supporting this! It gets flagged in our ADA review of Divi sites all the time.

nighswon avatar Feb 01 '22 16:02 nighswon

Same. The attribute is redundant.

joelhsmith avatar Mar 07 '22 19:03 joelhsmith

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.

mrwweb avatar Oct 14 '22 18:10 mrwweb

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.

eartahhj avatar Apr 28 '23 16:04 eartahhj