Skip to content
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

Hide links to images without alt-tag for screen readers #2801

Closed
LeandraH opened this issue May 14, 2024 · 2 comments · Fixed by #2901
Closed

Hide links to images without alt-tag for screen readers #2801

LeandraH opened this issue May 14, 2024 · 2 comments · Fixed by #2901
Assignees
Labels
feature New feature or request
Milestone

Comments

@LeandraH
Copy link

Motivation

The problem are images that don't have an alt-tag, we automatically give them an alt-tag of an empty string. That then means that a screen reader skips them. But the images are wrapped in an anchor tag linking to the image location. Since those anchor tags don't have any text to read out (remember, the content of the anchor is an image that the screen reader skips), the screen reader reads out the last part of the address of the image, which is the name that the file had when it was uploaded. That's pretty confusing.

Proposed Solution

We decided in the weekly tech meeting that images that don't need to be described by the screen reader also don't need to have the ability to click on them, especially since the linking to image location is mainly so that a user can enlarge the picture. If the picture isn't important to see, a bigger version of it is unlikely to be important either.

The way to do that is to add the attribute aria-hidden="true" to the surrounding anchor tag.

So the idea is: if an image has no alt-tag or an alt-tag of an empty string, also give it an aria-hidden="true".

Alternatives

We could also remove the links entirely for images without an alt-tag since those probably don't need to be enlarged.

User Story

Additional Context

We also discussed this in digitalfabrik/integreat-app#2765

@LeandraH LeandraH added the feature New feature or request label May 14, 2024
@MizukiTemma
Copy link
Member

@LeandraH
Could you assign this issue to a milestone?

@JoeyStk
Copy link
Contributor

JoeyStk commented May 21, 2024

Could you assign this issue to a milestone?

We had a chat and agreed that is a nice-to-have in the near future, but not urgent. Therefore I added it to 24Q4

@JoeyStk JoeyStk added this to the 24Q4 milestone May 21, 2024
@lunars97 lunars97 self-assigned this Jul 10, 2024
@osmers osmers modified the milestones: 24Q4, 24Q3 Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants