Skip to content

Commit

Permalink
Fix html validation for Image component sizer (#27767)
Browse files Browse the repository at this point in the history
According to [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute#deciding_between_aria-hiddentrue_rolepresentation_and_rolenone):


- `aria-hidden="true"` will remove the entire element from the accessibility API. 
- `role="presentation"` will remove the semantic meaning of an element while still exposing it to assistive technology. 

We don't need both so we'll keep `aria-hidden="true"` since the element is used for sizing, not content that should be read.

Fixes #27163
  • Loading branch information
styfle committed Aug 4, 2021
1 parent 3ab5d60 commit 2061d6c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/next/client/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,6 @@ export default function Image({
}}
alt=""
aria-hidden={true}
role="presentation"
src={`data:image/svg+xml;base64,${toBase64(sizerSvg)}`}
/>
) : null}
Expand Down

0 comments on commit 2061d6c

Please sign in to comment.