Skip to content

Commit

Permalink
[@mantine/core] Set aria-hidden on Checkbox and Radio icons to prev…
Browse files Browse the repository at this point in the history
…ent them being announced by screen readers (#5202)
  • Loading branch information
rtivital committed Nov 7, 2023
1 parent 6214fc0 commit 233f924
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mantine-core/src/components/Checkbox/CheckIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function CheckIcon({ size, style, ...others }: CheckIconProps) {
fill="none"
xmlns="http://www.w3.org/2000/svg"
style={_style}
aria-hidden
{...others}
>
<path
Expand All @@ -33,7 +34,13 @@ export function CheckIcon({ size, style, ...others }: CheckIconProps) {
export function CheckboxIcon({ indeterminate, ...others }: CheckboxIconProps) {
if (indeterminate) {
return (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 32 6" {...others}>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 32 6"
aria-hidden
{...others}
>
<rect width="32" height="6" fill="currentColor" rx="3" />
</svg>
);
Expand Down
1 change: 1 addition & 0 deletions src/mantine-core/src/components/Radio/RadioIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function RadioIcon({ size, style, ...others }: RadioIconProps) {
fill="none"
viewBox="0 0 5 5"
style={{ width: rem(size), height: rem(size), ...style }}
aria-hidden
{...others}
>
<circle cx="2.5" cy="2.5" r="2.5" fill="currentColor" />
Expand Down

0 comments on commit 233f924

Please sign in to comment.