diff --git a/.changeset/a11y-list-hide-icons-from-assistive-tech.md b/.changeset/a11y-list-hide-icons-from-assistive-tech.md new file mode 100644 index 000000000..78db391ae --- /dev/null +++ b/.changeset/a11y-list-hide-icons-from-assistive-tech.md @@ -0,0 +1,5 @@ +--- +'react-magma-dom': patch +--- + +fix(List): Hide SVGs from assistive tech by adding `aria-hidden="true"` to the `span` element that wraps the SVGs. diff --git a/packages/react-magma-dom/src/components/List/List.test.js b/packages/react-magma-dom/src/components/List/List.test.js index 728bb8f5f..8787bf265 100644 --- a/packages/react-magma-dom/src/components/List/List.test.js +++ b/packages/react-magma-dom/src/components/List/List.test.js @@ -53,6 +53,10 @@ describe('List', () => { 'borderRadius', '50%' ); + expect(container.querySelector('span')).toHaveAttribute( + 'aria-hidden', + 'true' + ); }); it('should render a list item with a small icon', () => { diff --git a/packages/react-magma-dom/src/components/List/ListItem.tsx b/packages/react-magma-dom/src/components/List/ListItem.tsx index 47541d982..c3df92582 100644 --- a/packages/react-magma-dom/src/components/List/ListItem.tsx +++ b/packages/react-magma-dom/src/components/List/ListItem.tsx @@ -96,6 +96,7 @@ export const ListItem = React.forwardRef( } iconColor={theme.colors[iconColor] || theme.colors.neutral100} theme={theme} + aria-hidden="true" > {icon}