Skip to content

[Switch] Use role="switch" #23216

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

Open
1 task done
oliviertassinari opened this issue Oct 23, 2020 · 2 comments
Open
1 task done

[Switch] Use role="switch" #23216

oliviertassinari opened this issue Oct 23, 2020 · 2 comments
Labels
accessibility a11y component: switch This is the name of the generic UI component, not the React module! on hold There is a blocker, we need to wait

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 23, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

The switch component is announced like a checkbox, it should be announced like a switch.

Examples 🌈

I have seen the role used in react-switch. After some digging, I could find this accessible resource that goes into more detail: https://scottaohara.github.io/a11y_styled_form_controls/src/checkbox--switch/. It seems that it's still too early to use the role, screenreaders support isn't high enough but we can revisit it in a year.

Motivation 🔦

Improve the distinction between Switch and Checkbox for screen readers. It's important per https://next.material-ui.com/components/switches/#when-to-use.

@oliviertassinari oliviertassinari added accessibility a11y on hold There is a blocker, we need to wait component: switch This is the name of the generic UI component, not the React module! labels Oct 23, 2020
@eps1lon
Copy link
Member

eps1lon commented Oct 26, 2020

After some digging, I could find this accessible resource that goes into more detail

Thanks to git the section is linked to #17870 where I already did the work and explained why I added this section. Not sure we need an issue to track this since this will probably just add notification-noise.

@oliviertassinari
Copy link
Member Author

@eps1lon Oh nice, I didn't find this pull request, thanks for the extra context. I'm adding the v6 milestone so we can revisit it at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: switch This is the name of the generic UI component, not the React module! on hold There is a blocker, we need to wait
Projects
Status: No status
Development

No branches or pull requests

3 participants