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

Editor: Accessibility: the alt attribute for images should not be auto-filled #335

Closed
designsimply opened this issue Nov 20, 2015 · 3 comments
Labels
Milestone

Comments

@designsimply
Copy link
Contributor

When an image is added and the alt text field is not modified, the filename is used by default:

<img class="alignnone size-large wp-image-2507" src="https://madefortesting426.files.wordpress.com/2015/11/img_2539.jpg?w=1024" alt="IMG_2539" width="1024" height="768" />

The alt="IMG_2539" part is not descriptive of the image's content and not helpful to screen readers and so it hinders accessibility to auto-fill it with possibly irrelevant data. It would be better to leave the attribute empty than pre-filling it.

This attribute defines the alternative text describing the image. Users will see this displayed if the image URL is wrong, the image is not in one of the supported formats, or if the image is not yet downloaded.

Usage note: Omitting this attribute indicates that the image is a key part of the content, but no textual equivalent is available. Setting this attribute to the empty string indicates that this image is not a key part of the content; non-visual browsers may omit it from rendering.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img

/cc davidakennedy (to make sure this recommendation is good re: accessibility best practices)

/hat tip kathrynwp for reporting this issue in Slack

From davidakennedy

Yes, I just noticed this too when uploading images to my blog just this week.

And @designsimply, you're correct. It would be better to leave the field unpopulated and let users fill it out as they see fit. It's up to them as content creators to use the alt attribute properly. We should stay out of their way. 😄

@designsimply designsimply added this to the Editor: Next milestone Nov 20, 2015
@aduth
Copy link
Contributor

aduth commented Nov 23, 2015

Noting that this behavior is consistent with wp-admin. Specifically, when uploading a new image, the "Title" field is prepopulated with the base filename. When inserting an image to the post editor, both wp-admin and the Calypso editor will fall back to the title if an alt is not assigned. If we were to change the behavior here, I'd recommend still allowing the title to be defaulted to the filename, though not fall back to the title in generating the markup.

@kristarella
Copy link

Perhaps we could auto-fill the alt field with the title only if the image had a custom title in the meta?

@designsimply
Copy link
Contributor Author

designsimply commented Dec 20, 2017

#bug-scrub #pre-gutenburg-bug-purge

Closing due to inactivity and because it is a minor issue. Please re-open if it comes up again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants