Link with nested role text results in error 'Links do not have a discernible name'
See original GitHub issueWhen a link has a nested element with role="text"
(added to stop ‘text splitting’ in VoiceOver iOS https://axesslab.com/text-splitting/) such as:
<a href="myurl.com">
<span role="text">
<span class="VisuallyHiddenText">Audio, </span>
<span>Today's headlines</span>
<span class="VisuallyHiddenText">, 1 minute 3 seconds</span>
</span>
</a>
This causes the following error when running an audit in Lighthouse Accessibility ‘Links do not have a discernible name’.
This error should not occur as the link does have a discernible name with the presence of role="text"
. See related issue: https://github.com/GoogleChrome/lighthouse/issues/9075
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
A11y error: Links do not have a discernible name
Links do not have a discernible name Link text (and alternate text for images, when used as links) that is discernible, unique, and...
Read more >Links must have discernible text | Axe Rules - Deque University
Ensure that all link names are accessible. It may be possible that the inner link text is not visible to a screen reader,...
Read more >Accessibility rule: Links must have discernible text
When used as links, link text and alternative text for images must be recognizable by screen readers, have no duplicate labels, and be...
Read more >Accessibility issue: Links do not have a discernible name - SEO
For accessibility reasons (required for screen readers) links must contain a text or have description in aria-label attribute. In many use cases ...
Read more >Link has non-empty accessible name | ACT Rule | WAI - W3C
When the link role is used on elements that do not behave as links, ... For area elements that have an href attribute,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nevermind I created one with the repro, just curious if the page with the example code you provided was in the wild somewhere 😃
It will be live on Monday! Can send it then if useful.