Skip to content

Commit

Permalink
Fix: Remove aria-label from images when alt text is empty (fixes #575)
Browse files Browse the repository at this point in the history
  • Loading branch information
swashbuck authored Aug 27, 2024
1 parent 9bc7db2 commit c5d707f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function Image(props) {
props?._srcFocalPoint && `object-position-${props?._srcFocalPoint}`
])}
src={src}
aria-label={a11y.normalize(props.alt)}
aria-label={props.alt ? a11y.normalize(props.alt) : null}
aria-hidden={!props.alt}
loading='eager'
aria-describedby={props.longdescription ? props.longDescriptionId : undefined}
Expand Down

0 comments on commit c5d707f

Please sign in to comment.