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

feat[dev]: ✨ implement A11y improvements to sd-switch #1488

Open
1 of 9 tasks
Tracked by #1465
yoezlem opened this issue Oct 9, 2024 · 0 comments
Open
1 of 9 tasks
Tracked by #1465

feat[dev]: ✨ implement A11y improvements to sd-switch #1488

yoezlem opened this issue Oct 9, 2024 · 0 comments
Labels
A11y Audit Identifies tasks related to accessibility improvements identified in the A11y audit of the DS 🔧 code needs changes in code Critical A11y Issue Require immediate attention and resolution Subtask Epic subtasks

Comments

@yoezlem
Copy link
Contributor

yoezlem commented Oct 9, 2024

Description

This task describes the Storybook implementation for the sd-switch component as part of the A11y improvements outlined in Epic #1465.

A11y improvements for sd-switch can be found here: sd-switch Notes.


Comment

Problem: Invalid checkboxes don't indicate that they're invalid.
Solution: Add and toggle aria-invalid="true" on the input element.

Problem: Error messages are semantically not connected to the respective input element and are only announced when the user unticks a required checkbox.
Solution: Instead of using a live region for the error message, connect it with the affected input field. Screen readers then announce the message automatically when the user focuses the checkbox.

Notes

  • Disabled switches: See @sd-button. Everything I wrote there about disabling form elements applies here as well.
  • Your switch looks like a switch, but semantically it's a checkbox. It has two states (on/off), although its role (checkbox) suggests that there are three states (checked/unchecked/indeterminate). If toggling the switch doesn't have an immediate effect, you can leave it as is. If toggling it executes JS immediately, consider using a button instead. For more details, read Adrian Roselli's three articles about that topic.

Best Practices

  • Avoid switches. Many users have hard time understanding them.

Additional resources

Open Questions towards design

  • Question1
  • Question2

DoR

  • Item has been estimated by the team
  • Item dependencies have been identified and documented

DoD

  • Documentation has been created/updated (if applicable)
  • Migration Guide has been created/updated (if applicable)
  • Relevant E2E tests (Features, A11y, Bug fixes) are created/updated
  • Relevant stories (Features, A11y) are created/updated
  • Implementation works successfully on feature branch
@yoezlem yoezlem added 🔧 code needs changes in code Subtask Epic subtasks labels Oct 9, 2024
@yoezlem yoezlem added the A11y Audit Identifies tasks related to accessibility improvements identified in the A11y audit of the DS label Oct 9, 2024
@yoezlem yoezlem added the Critical A11y Issue Require immediate attention and resolution label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A11y Audit Identifies tasks related to accessibility improvements identified in the A11y audit of the DS 🔧 code needs changes in code Critical A11y Issue Require immediate attention and resolution Subtask Epic subtasks
Projects
Status: ⚙️ To be refined
Development

No branches or pull requests

1 participant