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
fix: now ToggleSwitch component has required label via aria-label or aria-labelledby #2035
Conversation
β Deploy Preview for oss-insights failed.
|
β Deploy Preview for design-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -1,27 +1,33 @@ | |||
import * as Switch from "@radix-ui/react-switch"; | |||
import clsx from "clsx"; | |||
|
|||
interface ToggleSwitchProps { | |||
type ToggleSwitchProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The props look a little more complex, but basically it's so that you can either have ariaLabel
or ariaLabelledBy
, not both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
## [1.74.0](v1.73.0...v1.74.0) (2023-11-06) ### π Features * add account deletion flow ([#1990](#1990)) ([daeb10e](daeb10e)) * add contributor's when editing a list ([#2016](#2016)) ([1a0b4da](1a0b4da)) * add GitHub Org Repositories sync to insight page creation ([#2023](#2023)) ([e5f38ac](e5f38ac)) * add GitHub team import to new list page ([#2006](#2006)) ([3113a74](3113a74)) * add grey background for delete account ([#2030](#2030)) ([ea10161](ea10161)) ### π Bug Fixes * add check to allow team member access for private insight pages ([#2049](#2049)) ([2e48b95](2e48b95)) * change avatar alignment with highlight input ([#2032](#2032)) ([dc409c4](dc409c4)) * change label style of bio to bold ([#2033](#2033)) ([647fca3](647fca3)) * chart tooltip cut in contributors card ([#2029](#2029)) ([7c16863](7c16863)) * code standard errors ([e93bdca](e93bdca)) * don't recommend discordapp & use user's full id ([c5cad45](c5cad45)) * don't recommend discordapp as url & use user's full id ([#2014](#2014)) ([58df997](58df997)) * dropdown flickery on single highlight card ([#2040](#2040)) ([672ce2f](672ce2f)) * eslint issue by using `eslint-disable` ([#1993](#1993)) ([bc285a2](bc285a2)) * made notifications buttons more accessible ([#2034](#2034)) ([50bcf9d](50bcf9d)) * occurence eslint disable ([3d84665](3d84665)) * remove build commands from netlify.toml ([#2018](#2018)) ([138a125](138a125)) * ToggleSwitch component has required label via aria-label or aria-labelledby ([#2035](#2035)) ([0684081](0684081))
Description
Now the
<ToggleSwitch />
component requires a label via either theariaLabel
prop or theariaLabellebBy
prop.See the MDN docs on the aria-label and aria-labelledby attributes.
I came across this fix while working on #1977
What type of PR is this? (check all applicable)
Related Tickets & Documents
Fixes #2036
Relates to #1977
Mobile & Desktop Screenshots/Recordings
2023-11-01.16-46-22.mp4
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?