Skip to content

Commit

Permalink
img — empty alt (#39)
Browse files Browse the repository at this point in the history
It's better for accessibility to add an empty alt attribute instead of none:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt
This resolves a lot of lighthouse error messages.
  • Loading branch information
thomasverleye authored Dec 20, 2021
1 parent f062ea6 commit 303250c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const Image: React.FC<ImagePropTypes> = function ({
{data.src && (
<img
src={data.src}
alt={data.alt}
alt={data.alt ?? ''}
title={data.title}
className={pictureClassName}
style={{ ...absolutePositioning, ...pictureStyle }}
Expand Down

0 comments on commit 303250c

Please sign in to comment.