-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Toggle and ToggleSmall aria-label is better placed on the checkbox, not the label element #6567
Comments
I am able to get VO to read out the aria-label on toggles at least in the storybook example, but I will await the feedback from our a11y experts about moving the label attribute to the input! |
@dakahn any thoughts on this one? |
We build for VoiceOver used in Safari as, like you pointed out, that is the ideal and most used browser pairing generally
That said, this component has problems. First and foremost WCAG Success Criterion 3.3.2 requires that form inputs have accessible labeling for both sighted users and users of assistive technologies. For a deeper dive see the section Intent in this Labeling and Instructions guide, Currently we allow users to hide the label (perhaps to set it themselves and hopefully not to "save space"). But with JAWS 2020 and an I think the If users don't want our visual label on the element directly we should just drop |
Does not to be an issue anymore when testing in VoiceOver in Chrome in the V11 storybook 👍🏻 |
Toggle and ToggleSmall aria-labels are misplaced - the attribute should go on the input element, not the label
Environment
Detailed description
VoiceOver on Chrome does not announce the aria-label of the Toggle element because the attribute is on the label element, not the input itself.
I expected the text of the aria-label to be announced by VoiceOver upon focusing on the toggle element.
The text was not announced, only the "tick box" and its on/off state.
Looking at the "accessible name computation" specification, it seems to me that the current setup, having an aria-label on a label, is not in the specification. The aria-label attribute would be better suited on the input element itself.
Steps to reproduce the issue
Additional information
Let me know if you found my reasoning solid, and I'll go ahead and create a PR!
The text was updated successfully, but these errors were encountered: