-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add accessibility props to Switch #4590
Conversation
Deploying orbit with Cloudflare Pages
|
Storybook staging is available at https://kiwicom-orbit-domi-switch-a11y.surge.sh Playroom staging is available at https://kiwicom-orbit-domi-switch-a11y.surge.sh/playroom |
Size Change: +25 B (+0.01%) Total Size: 459 kB
ℹ️ View Unchanged
|
e1a0cb3
to
b6f3289
Compare
ariaControls, | ||
ariaLabel, |
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.
I added ariaLabel
as I believe both ariaLabel
and ariaLabelledby
should be available.
I added ariaControls
as Switch is currently used in multiple places where it controls other elements, e.g. in Search it's used in the Price Alert where switching it on can display Sign In modal for logged out users and when switched off it, it displays the modal. Same for booking where Switch controls the the Billing details Card to be expanded/collapsed. I believe that in these situations aria-controls
should be set.
f9fdfda
to
1b2d1f1
Compare
docs/src/documentation/03-components/07-interaction/switch/03-accessibility.mdx
Outdated
Show resolved
Hide resolved
83dddfd
to
28dcb31
Compare
28dcb31
to
08d9739
Compare
Closes https://kiwicom.atlassian.net/browse/FEPLT-2212
✨
Description by Callstackai
This PR adds accessibility properties to the Switch component, enhancing its usability with assistive technologies. It introduces
ariaControls
,ariaLabel
, and updates the documentation accordingly.Diagrams of code changes
Files Changed
This PR includes files in programming languages that we currently do not support. We have not reviewed files with the extensions
.mdx
,.md
. See list of supported languages.