-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessibility: Is the aria-label text too redundant? #63
Comments
Thanks for the heads up. The reason I set it up like this in the first place is that a permalink isn't useful unless you know what you are linking to. The scenario I wanted to avoid was screenreader-users hopping around a page, finding permalinks but not knowing what they link to (since they can't use visual closeness of the link to provide that context). In short, erring on the side of providing more information. It's hard to say whether that redundancy has costs outweighing the benefits, especially since neither of us are regular screenreader users. If I got enough feedback from screenreader users that the redundancy is distracting/unnecessary, then I'd pull it out. Any chance you know anybody like that who can provide feedback? I'll like to leave this issue open for a while to collect that kind of feedback, if anybody has it. |
Hi! @yellowled and I just discussed this issue over e-mail, and of course the most obvious idea came to me after we had basically finished our back and forth. I am a screen reader user and also find this redundant information distracting when the heading is read. An idea that just came to me was to move the link outside the tag, directly after it. That way, when screen readers jump to the heading (which we usually have a direct screen reader shortcut for), the heading would be read, but the link would not. OK, it would follow right after the link, but at least it would reduce the chattiness when just reading the heading. Or you could put it directly before the heading, so screen reader users would come across it while reading the page top to bottom, but not if jumping directly to a heading. Some experimentation might be in order here. This is the first time someone has asked me about this particular technique, so I am not aware of any long-term proven solution yet.I heard from Matthias that Github does this, too, but I am not sure where exactly this is. The comments (like in this thread) all have a permalink to themselves within the text that is the timestamp when the comment was posted, so the problem getss avoided that way, and no redundant text is given. Hope one of these ideas helps! |
Ouch, sorry for the bad formatting! I didn't think Github would interpret that HTML snippet directly from within the text. :-( |
Adding a summary of what we discussed before for @bryanbraun for consistency. @MarcoZehe, please correct me if I got something wrong.
|
@MarcoZehe GitHub does this in Markdown documents like the |
Thanks for the feedback @MarcoZehe and @yellowled. There are some complications with wrapping the heading in the anchor link, especially since these links are designed to be used in more places than just headings (like paragraphs). Wrapping the link in cases like that could result in links within links... not a good situation. I see your point about the links being fairly useless for most screenreader users, and I'm interested in Github's approach of simply hiding them (especially because it looks like older versions of their site didn't hide them with aria-hidden). It might be a good idea to look at some other major sites to see if they treat them similarly. For reference, I looked up some of the downsides of having focusable elements with One option we haven't mentioned yet is to just make the permalink text as succinct as possible, making it say something like "Permalink". That would reduce the redundancy of repeating the title twice, while not introducing the complexities of hiding it. Thoughts on that? |
That would work for me. |
I never noticed since I still use a feed reader, but Smashing Magazine also has these links. Seems like they use just “Link” as the link text (which is replaced with a PNG image) and an |
That's interesting about Smashing's. Their aria-labels look a lot like ours: I'm still leaning towards @MarcoZehe's recommendation to make it less redundant by shortening it, but I'd like to keep my eyes open for other examples for a bit just to see what else is out there. (for the record, I found a couple examples that don't use any aria attributes, like Read the Docs and Anchorific, though I'm more inclined to believe that it's due to oversight rather than deliberate choice). Thanks for your assistance and patience, both of you! |
Shorten the
|
@RichCaloggero, thanks for your input and the example you shared. That description makes it easier to understand what people are experiencing. I've let this issue sit for a bit, but now's a good time to pick it back up and make a decision. It sounds like everyone in the discussion is on board with shortening it and your input confirms that approach. I'm ok with your suggestion of simply calling it "anchor". I'll put together a PR. |
☝️ PR is up. If anybody has feedback, let me know in the next couple of days, after which I'll merge. |
See the discussion at <bryanbraun/anchorjs#63>. Basically if the `aria-label` for heading anchor links duplicates the heading text itself, this gets really annoying for people using screenreaders. On the other hand it is bad practice to use `aria-hidden="true"` on a focusable element (the heading anchor links can be reached by tabbing). Therefore the best solution was to use a short `aria-label`. In my case I am using the label "Permalink".
Someone just notified me that the
aria-label
for the anchor links is kind of redundant in screenreaders.For example, if I use a heading
<h3>My heading</h3>
, the anchor link for that will getaria-label="Anchor link for: my heading"
, which seems to (I'm not a screenreader user myself) be read as something like “Heading level 3 My heading Anchor link for: my heading" in at least some screenreader/browser combinations.My suggestion would be to reduce the default
aria-label
to something like “Permalink”, “Link to this” or something like that? Also, you might want to make this label text configurable for i18n.The text was updated successfully, but these errors were encountered: