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

va-checkbox and va-radio-option: Improved a11y #1442

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Andrew565
Copy link
Contributor

@Andrew565 Andrew565 commented Dec 19, 2024

Chromatic

https://3363-redo-radios-and-checks--65a6e2ed2314f7b8f98609d8.chromatic.com


Description

Closes #3363

Reworks some of the HTML for the va-checkbox and va-radio-option components to be more accessible.

QA Checklist

  • Component maintains 1:1 parity with design mocks
  • Text is consistent with what's been provided in the mocks
  • Component behaves as expected across breakpoints
  • Accessibility expert has signed off on code changes (if applicable. If not applicable provide reason why)
  • Designer has signed off on changes (if applicable. If not applicable provide reason why)
  • Tab order and focus state work as expected
  • Changes have been tested against screen readers (if applicable. If not applicable provide reason why)
  • New components are covered by e2e tests; updates to existing components are covered by existing test suite
  • Changes have been tested in vets-website using Verdaccio (if applicable. If not applicable provide reason why)

Screenshots

Before:
Screenshot 2024-12-18 at 10 51 13 AM
After:
Screenshot 2024-12-18 at 10 51 25 AM

Acceptance criteria

  • QA checklist has been completed
  • Screenshots have been attached that cover desktop and mobile screens

Definition of done

  • Documentation has been updated, if applicable
  • A link has been provided to the originating GitHub issue (or connected to it via ZenHub)

@Andrew565 Andrew565 added the patch Patch change in semantic versioning label Dec 19, 2024
@Andrew565 Andrew565 requested review from rsmithadhoc and a team December 19, 2024 16:38
@Andrew565 Andrew565 self-assigned this Dec 19, 2024
@Andrew565 Andrew565 requested a review from a team as a code owner December 19, 2024 16:38
@babsdenney
Copy link

babsdenney commented Dec 19, 2024

@Andrew565 Could we fix the box size and radius to align with the USWDS? Attached shows the USWDS with a 20x20 square size and border radius of 2px.
image

The focus state in the Figma design has a gap between the focus state and the gold outline, USWDS is showing the same thing. Could we follow that design for the focus state. The USWDS also shows a gap.

Checkbox in this PR
image
VADS
image
USWDS
image

Copy link
Contributor

@rsmithadhoc rsmithadhoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Andrew565 This looked good to me. I was able to confirm that this resolves the Axe issues. I also gave it a quick test in VoiceOver and everything sounded as expected.

One minor thing I saw was when initially tabbing to the radio group, there's an additional outline next to the first item. My guess is that a stray pseudo or hidden element might be getting styled.
image

@babsdenney
Copy link

Similar to the checkboxes, could we increase the size of the radio button to match the USWDS?

  • Increase the size from 16x16 to 20x20
  • Create a gap between the focus ring and the radio circle

VADS
image

USWDS
image

@Andrew565
Copy link
Contributor Author

@rsmithadhoc Fixed the ghost outline, thanks for pointing that out.

@babsdenney I fixed the outline gaps and made sure the sizing was consistent for both radios and checkboxes. If you inspect a non-checked checkbox or radio, it will appear in the sizing model as though it's 16x16, but this isn't including the 2px border on all sides, which raises the 'total size' to 20x20. Screenshots attached.

Screenshot 2024-12-20 at 4 18 56 PM
Screenshot 2024-12-20 at 4 25 21 PM
Screenshot 2024-12-20 at 4 25 34 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Patch change in semantic versioning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix incorrect markup on radio buttons and checkbox components to support accessibility
3 participants