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

Bug: Swap has various accessibility issues #1290

Open
samcartersmith opened this issue Sep 24, 2024 · 1 comment
Open

Bug: Swap has various accessibility issues #1290

samcartersmith opened this issue Sep 24, 2024 · 1 comment

Comments

@samcartersmith
Copy link

Describe the bug and the steps to reproduce it

  1. Go to https://onchainkit.xyz/#swap
  2. Tab around the Swap component
  3. Turn on a screen reader
  4. Experience button labels with a screen reader

Issues

  • The drop-down for selecting asset type have a confusing label and do not communicate name, state, or value
  • The swap direction icon has no label
  • There is no keyboard focus on the drop-down
  • Dropdown asset selectors should function like select HTML components
  • Red is used to indicate an error which is not clear to all users

Asset Selector
Screenshot 2024-09-24 at 10 00 16 AM

Swap Direction Button
Screenshot 2024-09-24 at 10 00 02 AM

What's the expected behavior?

Suggested Fixes

  • The drop-down for selecting asset type has a confusing label and do not communicate name, state, or value
    You can use this spec as an example. https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/. When the user focuses the asset selector they should hear the following: purpose, value, and role. For example, "asset selector, ETH, combobox".
  • The swap direction icon has no label
    Use an aria-label on the button. For example, aria-label="change swap direction"
  • There is no visual keyboard focus on the drop-down
    Use an outline to indicate focus that meets a 3:1 contrast ratio or above.
  • Visual focus indicators are not easy to see
    Use an outline that meets a 3:1 or above contrast ratio.

What version of the libraries are you using?

No response

@fakepixels
Copy link
Contributor

Thanks so much for the detailed write up @samcartersmith

We're looking into it! 🫡

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

No branches or pull requests

2 participants