Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Adding aria-hidden to Checkbox Component's SVG for Screen Reader Compatibility #5202

Closed
paribartandhakal opened this issue Nov 6, 2023 · 2 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@paribartandhakal
Copy link

What package has an issue?

@mantine/core

Describe the bug

When using the Checkbox component, the SVG inside it is not hidden from screen readers, affecting the accessibility of the page when read by a screen readers, as the control first reaches the input and then the SVG, interrupting the flow of interaction and comprehension.

This is how it's rendered no:
<input id="mantine-90q2t4cqu" type="checkbox" class="mantine-6z0c4w checked:bg-accent checked:border-accent mantine-Checkbox-input" aria-label="some text"> <svg viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg" class="___ref-icon mantine-q9qwbl mantine-Checkbox-icon"><path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>

What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

6.0.21

If possible, please include a link to a codesandbox with a minimal reproduction

No response

Do you know how to fix the issue

None

Do you want to send a pull request with a fix?

None

Possible fix

Give access so that we can set aria-hidden="true" to the SVG element to ensure it is not announced by screen readers, improving the accessibility of the Checkbox component

rtivital added a commit that referenced this issue Nov 7, 2023
@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Nov 7, 2023
@rtivital
Copy link
Member

rtivital commented Nov 7, 2023

Fixed in 7.2.1. Now Checkbox icon has aria-hidden attribute.

@rtivital rtivital closed this as completed Nov 7, 2023
@paribartandhakal
Copy link
Author

Fixed in 7.2.1. Now Checkbox icon has aria-hidden attribute.

Thank you for this prompt fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants