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

Inconsistent image block behavior with alt tags #28654

Closed
dingo-d opened this issue Feb 2, 2021 · 3 comments
Closed

Inconsistent image block behavior with alt tags #28654

dingo-d opened this issue Feb 2, 2021 · 3 comments
Labels
[Block] Image Affects the Image Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility

Comments

@dingo-d
Copy link
Member

dingo-d commented Feb 2, 2021

Description

When we select the image the alt tag is pulled from the media library. In the image options this can be changed.
But the problem is that this change is not reflected in the media library, and you can have many different alt tag descriptions for the same image. Which seems a bit odd to me, no?

Step-by-step reproduction instructions

Screen.Recording.2021-02-02.at.11.10.36.mov

Expected behavior

Changing the alt tag in the options of the image component should update the alt tag in the media as well.

Actual behavior

This doesn't happen. Updating the options saves the alt tag just as an image alt in the editor. Alt tag set in the media library is stored in the postmeta under _wp_attachment_image_alt meta key.

Screenshots or screen recording (optional)

See above.

WordPress information

  • WordPress version: 5.6.0
  • Gutenberg version: Core
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes (2020)

Device information

  • Device: Desktop
  • Operating system: Mac OS 11.1
  • Browser: Version 88.0.4324.96 (Official Build) (x86_64)
@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Image Affects the Image Block labels Feb 2, 2021
@brentswisher brentswisher added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility and removed [Type] Bug An existing feature does not function as intended labels Feb 3, 2021
@brentswisher
Copy link
Contributor

I've run into this before and thought that same thing. My understanding is that it is indeed the desired behavior, so I removed the Bug label. Based on the way an image is used on a page, the alt text could be different. So if it is just an image on its own, it would be describing the image. If it was an image that was the only content in a link, it should be describing the image and what would happen if you click it.

If updating from the editor updated the media library and all instances in other pages, it could cause issues if the images were used differently on a different page. I've added the labels for the accessibility team, so maybe someone can provide confirmation or some more explanation.

@skorasaurus
Copy link
Member

As @brentswisher stated,
alt-text does not describe the content of an image; it describes how the image is used in the particular context of the webpage.

The same image can be used on 2 different pages and its alt-text can be different if it is used in different contexts.
Has some examples of different alt-text usage: https://axesslab.com/alt-texts/

There's more discussion on this decision by the Accessibility team at #8941 (comment) and https://core.trac.wordpress.org/ticket/47456

Please reopen if you want to discuss further.

@dingo-d
Copy link
Member Author

dingo-d commented Feb 19, 2021

Cool, wasn't aware of the broader discussion about this issue. And indeed this seems like something that will require WP core fixes as well (pulling the correct alt image based on where the image is used).

Thanks for the explanation, I appreciate it 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Accessibility Feedback Need input from accessibility
Projects
None yet
Development

No branches or pull requests

4 participants