Skip to content

Commit 1f0352c

Browse files
committed
handle alt better
1 parent 12f8095 commit 1f0352c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/react/ImageBlurPreloader.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const ImageBlurPreloader: FC<Props> = ({
5252
// blur image must use size from main image
5353
width: mainAttributes.width,
5454
height: mainAttributes.height,
55-
alt: !isLoadingMain ? mainAttributes.alt : '',
5655
};
5756

5857
const hasImage = Boolean(
@@ -69,6 +68,7 @@ const ImageBlurPreloader: FC<Props> = ({
6968
<img
7069
{...blurAttributes}
7170
{...commonAttributes}
71+
alt={!isLoadingBlur ? blurAttributes.alt : ''}
7272
onLoad={() => setIsLoadingBlur(false)}
7373
className={cn('object-cover absolute top-0 left-0 size-full', className)}
7474
/>
@@ -77,6 +77,7 @@ const ImageBlurPreloader: FC<Props> = ({
7777
<img
7878
{...mainAttributes}
7979
{...commonAttributes}
80+
alt={!isLoadingMain ? mainAttributes.alt : ''}
8081
onLoad={handleLoadMain}
8182
className={cn(
8283
'object-cover absolute top-0 left-0 size-full',

src/components/react/ImageRandom.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const ImageRandomReact: FC<Props> = ({ galleryImages, className, divClassName, .
4242
return (
4343
<ImageBlurPreloader
4444
{...props}
45-
blurAttributes={{ ...image.blur, alt: '' }}
45+
blurAttributes={{ ...image.blur, alt: 'Blur image' }}
4646
mainAttributes={{ ...image.hero, onClick: handleClick, alt: 'Hero image' }}
4747
className={cn('cursor-pointer my-0', className)}
4848
divClassName={divClassName}

0 commit comments

Comments
 (0)