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

Legge til role="switch" i ToggleSwitch #2561

Open
andrea-sb1 opened this issue Feb 20, 2025 · 3 comments
Open

Legge til role="switch" i ToggleSwitch #2561

andrea-sb1 opened this issue Feb 20, 2025 · 3 comments
Assignees
Labels
👓 a11y Accessibility

Comments

@andrea-sb1
Copy link
Contributor

For at ToggleSwitch-er skal leses opp av skjermlesere på en måte som best mulig gjenspeiler hvordan de ser ut og oppfører seg visuelt, anbefaler W3C å bruke role="switch". Skjermlesere leser da opp «på, bytt»/«av, bytt» i stedet for «markert, avmerkingsboks»/«ikke markert, avmerkingsboks» som leses opp nå.

«Switch role. A switch provides approximately the same functionality as a checkbox and toggle button, but makes it possible for assistive technologies to present the widget in a fashion consistent with its on-screen appearance.»
https://w3c.github.io/aria/#switch

https://www.w3.org/WAI/ARIA/apg/patterns/switch

Foreslår derfor å legge til role="switch" (i tillegg til type="checkbox") i input-elementet til ToggleSwitch-komponenten.

@hagenek
Copy link
Contributor

hagenek commented Feb 20, 2025

Laget en PR, håper det kommer opp en versjon av storybook hvor vi kan teste forandringen sammen.

@andrea-sb1
Copy link
Contributor Author

andrea-sb1 commented Feb 20, 2025

Laget en PR, håper det kommer opp en versjon av storybook hvor vi kan teste forandringen sammen.

Herlig, @hagenek!

Fungerer som forventet når jeg tester med skjermleser (VoiceOver) i Safari og Chrome på Mac. Skjermleser leser nå opp «på, bytt»/«av, bytt» i stedet for «markert, avmerkingsboks»/«ikke markert, avmerkingsboks» 👍

  • MacBook Air
  • macOS Sequoia 15.3.1
  • Safari 18.3
  • Chrome 133.0.6943.127

@hagenek hagenek self-assigned this Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👓 a11y Accessibility
Projects
None yet
Development

No branches or pull requests

2 participants