fix: remove redundant role="img" when lazyLoad is enabled#250
Merged
ibrahimcesar merged 1 commit intomainfrom Feb 17, 2026
Merged
fix: remove redundant role="img" when lazyLoad is enabled#250ibrahimcesar merged 1 commit intomainfrom
ibrahimcesar merged 1 commit intomainfrom
Conversation
Bump version to 3.4.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
size-limit report π¦
|
Owner
Author
|
Published on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #249
When
lazyLoad={true}, the component renders an actual<img>element inside the container for the thumbnail. However, the container also hadrole="img"applied, creating redundant ARIA semantics that fail automated accessibility audits (Axe, Lighthouse, WAVE).role="img"only whenlazyLoadis not enabled and the iframe is inactivelazyLoadis enabled, the real<img>element already provides correct semantics for assistive technologieslazyLoadis disabled (CSS background-image),role="img"is still applied since there's no native image elementTest plan
lazyLoad={true}: container should not haverole="img", the inner<img>handles semanticslazyLoad={false}(default): container should still haverole="img"as beforeπ€ Generated with Claude Code