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

Toggle button a11y #2982

Closed
myasonik opened this issue Mar 4, 2020 · 2 comments
Closed

Toggle button a11y #2982

myasonik opened this issue Mar 4, 2020 · 2 comments

Comments

@myasonik
Copy link
Contributor

myasonik commented Mar 4, 2020

Summary

Toggle buttons as an <input /> aren't very accessible (keyboard controls for buttons and inputs are different and voice control software won't recognize what you're trying to do)

What to do?

  • Switch to using a <button />
  • Either
    • require two label props (one for the "on" state, another for the "off" state)
    • if only one label is provided, set aria-pressed="true|false" (people could abuse this and change the single string they pass in so we might want to cache the first string recieved so implementing developers see that they did it wrong)
    • (all of these "label" props should probably actually be an object to allow for a string and an icon to be passed in)
@anishagg17
Copy link
Contributor

@myasonik i am working on this

@myasonik
Copy link
Contributor Author

Per #3023, we'll be deprecating this component completely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants