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

fix: now ToggleSwitch component has required label via aria-label or aria-labelledby #2035

Merged
merged 8 commits into from Nov 2, 2023

Conversation

nickytonline
Copy link
Member

@nickytonline nickytonline commented Nov 1, 2023

Description

Now the <ToggleSwitch /> component requires a label via either the ariaLabel prop or the ariaLabellebBy 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)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Fixes #2036
Relates to #1977

Mobile & Desktop Screenshots/Recordings

2023-11-01.16-46-22.mp4

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Copy link

netlify bot commented Nov 1, 2023

❌ Deploy Preview for oss-insights failed.

Name Link
πŸ”¨ Latest commit d81fbf0
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/654390f0b4638f0008214546

Copy link

netlify bot commented Nov 1, 2023

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit d81fbf0
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/654390f03102f8000824b635
😎 Deploy Preview https://deploy-preview-2035--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nickytonline nickytonline marked this pull request as ready for review November 1, 2023 21:10
@@ -1,27 +1,33 @@
import * as Switch from "@radix-ui/react-switch";
import clsx from "clsx";

interface ToggleSwitchProps {
type ToggleSwitchProps = {
Copy link
Member Author

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.

Copy link
Contributor

@OgDev-01 OgDev-01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brandonroberts brandonroberts merged commit 0684081 into beta Nov 2, 2023
12 checks passed
@brandonroberts brandonroberts deleted the nickytonline/accessible-toggle-switch branch November 2, 2023 12:30
@nickytonline nickytonline changed the title fix: ToggleSwitch component has required label via aria-label or aria-labelledby fix: now ToggleSwitch component has required label via aria-label or aria-labelledby Nov 2, 2023
open-sauced bot pushed a commit that referenced this pull request Nov 2, 2023
## [1.74.0-beta.11](v1.74.0-beta.10...v1.74.0-beta.11) (2023-11-02)

### πŸ› Bug Fixes

* dropdown flickery on single highlight card ([#2040](#2040)) ([672ce2f](672ce2f))
* ToggleSwitch component has required label via aria-label or aria-labelledby ([#2035](#2035)) ([0684081](0684081))
open-sauced bot pushed a commit that referenced this pull request Nov 6, 2023
## [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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Require ToggleSwitch component to have a label
3 participants