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

img element inside picture tag does not include alt attribute #903

Open
2 tasks done
boogah opened this issue Oct 2, 2024 · 0 comments
Open
2 tasks done

img element inside picture tag does not include alt attribute #903

boogah opened this issue Oct 2, 2024 · 0 comments

Comments

@boogah
Copy link

boogah commented Oct 2, 2024

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version
  • Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug
When using picture tags to display next-gen images, I've noticed that the img element does not include an alt attribute, even when alt text is set for the image in the Media Library.

To Reproduce
Steps to reproduce the behavior:

  1. In "Settings -> Imagify", pick a next-gen image format and check "Display images in Next-Gen format on the site".
  2. Select the "Use <picture> tags (preferred)" option and click Save Changes.
  3. Navigate to a page on the front end of the site and view source.
  4. Notice the img element inside the picture tag does not include an alt attribute. Not even a blank one.

Expected behavior
If I or another user has bothered to set alt text for an image, it should be displayed in the site's HTML.

Additional context
This is making the site less accessible to screen reader users as well as fail accessibility checks.

Acceptance Criteria (for WP Media team use only)
Clear instructions for developers, to be added before the grooming

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

No branches or pull requests

1 participant