From d0872d91388cf2b6dc38322fb48227997b7c963b Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Tue, 20 Aug 2024 10:29:39 -0600 Subject: [PATCH] Remove aria-label from images when alt text is empty --- templates/image.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/image.jsx b/templates/image.jsx index 2c6f938e..e2fa4b40 100644 --- a/templates/image.jsx +++ b/templates/image.jsx @@ -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}