Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Multiple of the same buttons - accessibility issue #837

Closed
bjorvack opened this issue Nov 6, 2018 · 2 comments · Fixed by #858
Closed

Multiple of the same buttons - accessibility issue #837

bjorvack opened this issue Nov 6, 2018 · 2 comments · Fixed by #858
Labels
accessibility Issues related to WCAG compliance

Comments

@bjorvack
Copy link
Contributor

bjorvack commented Nov 6, 2018

Some pages like https://thecodingtrain.com/CodingChallenges/ have multiple buttons with the same text. "Watch on YT" for example. While this works fine it's problematic for accessibility.

One off the most used features of a screen reader is getting a list with all the links on a page.
When users are presented with a bunch of the same text, they are forced to go through the whole page to get a clearer picture.

What I suggest is to add a more detailed description of the link in a span that puts it offscreen.

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

<a href="#"> Watch on YT <span class="sr-only">: Coding challenge #121 - Logo Interpreter</span> </a>

@bjorvack bjorvack changed the title Multiple of the same buttons Multiple of the same buttons - accessibility issue Nov 6, 2018
@vimkat
Copy link
Member

vimkat commented Nov 6, 2018

Thanks for pointing this out!

Maybe instead of integrating it into the button title, we could maybe make use of the title attribute on the anchor tag?

@vimkat vimkat added the accessibility Issues related to WCAG compliance label Nov 6, 2018
@bjorvack
Copy link
Contributor Author

bjorvack commented Nov 6, 2018

While that should work, not all screen readers use the alt or title tag if there is a link text. If we use a span in a link text this issue is avoided

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility Issues related to WCAG compliance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants