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

fix(a11y): add better aria labels for yes/no component #4876

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

justynoh
Copy link
Contributor

@justynoh justynoh commented Sep 15, 2022

Problem

Yes/No fields currently are too verbose, as they used to say "quotation mark, No, quotation mark, selected, required invalid data, radio button, 1 of 2". Then, tabbing to the next option actually goes to "No, selected" before the yes option is read.

Closes #4176

Solution

Refactor component to better suit its purpose (expose only leftIcon and label props rather than generic react children; this is also better for a11y to easily strip away the additional cosmetic icon). Remove visually hidden in favor of aria-label, which seems to work better for buttons. Now, it says

"No option, unselected, button"
"Yes option, unselected, button"

Breaking Changes

  • No - this PR is backwards compatible

@justynoh justynoh marked this pull request as ready for review September 15, 2022 08:49
@justynoh justynoh merged commit 723dd67 into form-v2/develop Sep 16, 2022
@justynoh justynoh deleted the form-v2/fix/a11y-yesno branch September 16, 2022 01:32
@justynoh justynoh mentioned this pull request Oct 5, 2022
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

Successfully merging this pull request may close these issues.

2 participants