Skip to content

Commit 5f51e5c

Browse files
committed
Hide icons for screen readers, use caption as aria-label for images with a fallback
1 parent 8c616a3 commit 5f51e5c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/Rollover/Rollover.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export function Rollover({
4141

4242
return (
4343
<a
44+
aria-label={caption || 'View image'}
4445
className={classNames('prezly-slate-image-rollover', className)}
4546
onClick={(event) => {
4647
event.preventDefault();
@@ -59,7 +60,10 @@ export function Rollover({
5960
})}
6061
>
6162
<span className="prezly-slate-image-rollover__caption-icon-container">
62-
<ArrowsAngleExpand className="prezly-slate-image-rollover__caption-icon" />
63+
<ArrowsAngleExpand
64+
aria-hidden="true"
65+
className="prezly-slate-image-rollover__caption-icon"
66+
/>
6367
</span>
6468

6569
<span className="prezly-slate-image-rollover__caption-text" ref={ref}>

src/elements/Contact/SocialField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function SocialField({ children, className, href, Icon }: Props) {
2020
rel="noreferrer noopener"
2121
target="_blank"
2222
>
23-
{Icon && <Icon className="prezly-slate-social-field__icon" />}
23+
{Icon && <Icon aria-hidden="true" className="prezly-slate-social-field__icon" />}
2424
{children && <span className="prezly-slate-social-field__value">{children}</span>}
2525
</a>
2626
</li>

0 commit comments

Comments
 (0)