From acbec5c8d40c2f7146cedcf9fe7e07d94c478426 Mon Sep 17 00:00:00 2001 From: nikitaorliak-cengage Date: Fri, 25 Oct 2024 17:19:20 +0200 Subject: [PATCH] fix(Dropdown): Hide SVGs from screen readers by adding `aria-hidden="true"` to the `svg` elements. (#1515) Co-authored-by: Nikita Orliak --- ...y-dropdown-hide-svg-from-screen-readers.md | 5 +++ .../Alert/__snapshots__/Alert.test.js.snap | 1 + .../__snapshots__/ButtonGroup.test.js.snap | 6 +++ .../src/components/Dropdown/Dropdown.test.js | 41 +++++++++++++++++-- .../components/Dropdown/DropdownButton.tsx | 8 ++-- .../Dropdown/DropdownSplitButton.tsx | 12 +++++- .../__snapshots__/IconButton.test.js.snap | 12 ++++++ .../src/components/IconButton/index.tsx | 9 ++-- 8 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 .changeset/a11y-dropdown-hide-svg-from-screen-readers.md diff --git a/.changeset/a11y-dropdown-hide-svg-from-screen-readers.md b/.changeset/a11y-dropdown-hide-svg-from-screen-readers.md new file mode 100644 index 0000000000..d7db6ac51c --- /dev/null +++ b/.changeset/a11y-dropdown-hide-svg-from-screen-readers.md @@ -0,0 +1,5 @@ +--- +'react-magma-dom': patch +--- + +fix(Dropdown): Hide SVGs from screen readers by adding `aria-hidden="true"` to the `svg` elements. diff --git a/packages/react-magma-dom/src/components/Alert/__snapshots__/Alert.test.js.snap b/packages/react-magma-dom/src/components/Alert/__snapshots__/Alert.test.js.snap index b843fe336a..31bb651f6e 100644 --- a/packages/react-magma-dom/src/components/Alert/__snapshots__/Alert.test.js.snap +++ b/packages/react-magma-dom/src/components/Alert/__snapshots__/Alert.test.js.snap @@ -267,6 +267,7 @@ exports[`Alert Dismissible should render a dismissible icon button with the warn id="ignoreSvg" >