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

Switch element doesn't have visible keyboard focus (a11y) #12499

Open
3 tasks done
siwood opened this issue Nov 4, 2022 · 0 comments
Open
3 tasks done

Switch element doesn't have visible keyboard focus (a11y) #12499

siwood opened this issue Nov 4, 2022 · 0 comments

Comments

@siwood
Copy link
Contributor

siwood commented Nov 4, 2022

What should happen?

To meet WCAG 2.0 A (minimum) accessibility requirements, keyboard focus must be visible for all interactive elements. Because the switch is styling the overrides an HTML checkbox, it needs to maintain visible focus/interactivity.

What happens instead?

When tabbing through a page with a switch element, the keyboard focuses on the element but nothing is visible, making it unclear/unusable for keyboard navigation.

Possible Solution

Something like:
.switch-input:focus + label { border: 2px solid get-color(primary-200); }

Test Case and/or Steps to Reproduce (for bugs)

How to reproduce:

  1. Go to any page with a switch element (for example, the documentation page)
  2. Use the keyboard to navigate through the page (tabs is generally the browser default)
  3. Notice that whenever the focus reaches a switch, it disappears.

Context

WCAG is a common and legally required standard to use for many websites.

Your Environment

  • Foundation version(s) used: 6.7.4 (and I think 6.7.5 if that's what the documentation page is using)
  • Browser(s) name and version(s): Chrome
  • Device, Operating System and version: MacOS

Checklist

  • I have read and follow the CONTRIBUTING.md document.
  • There are no other issues similar to this one.
  • The issue title and template are correctly filled.
Arash1381-y added a commit to Arash1381-y/foundation-sites that referenced this issue Jan 5, 2023
Adding two extra color for active-switch and not-active-switch on focus(focus visible). the changing color only occurs on keyboard events (like tab)

Resolves: foundation#12499
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

No branches or pull requests

1 participant