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

Improve filterable list controls a11y #5996

Merged
merged 2 commits into from
Sep 17, 2020
Merged

Improve filterable list controls a11y #5996

merged 2 commits into from
Sep 17, 2020

Conversation

contolini
Copy link
Member

Add a group role to the filterable list controls checkboxes parents so that screenreaders announce the group name when navigating to the checkbox children.

Normally our use of <legend> and <label> would do this automatically but we nest the checkboxes inside an unordered list so we need to manually tell the browser that the items are grouped.

See https://github.local/CFGOV/platform/issues/3356 for background.

Additions

  • role attribute to the category and status unordered lists.

How to test this PR

  1. Start voiceover.
  2. Go to http://0.0.0.0:8000/about-us/blog/
  3. Use the tab key to navigate to the Category checkboxes in the filter controls.
  4. It should announce "Category group" after announcing the first checkbox item.
  5. Go to https://www.consumerfinance.gov/about-us/blog/ and notice that it doesn't announce the group name.

Checklist

  • PR has an informative and human-readable title
    • PR titles are used to generate the change log in releases; good ones make that easier to scan.
    • Consider prefixing, e.g., "Mega Menu: fix layout bug", or "Docs: Update Docker installation instructions".
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines
  • Future todos are captured in comments and/or tickets
  • Project documentation has been updated, potentially one or more of:
    • This repo’s docs (edit the files in the /docs folder) – for basic, close-to-the-code docs on working with this repo
    • CFGOV/platform wiki on GHE – for internal CFPB developer guidance
    • CFPB/hubcap wiki on GHE – for internal CFPB design and content guidance

Front-end testing

Browser testing

Visually tested in the following supported browsers:

  • Firefox
  • Chrome
  • Safari
  • Edge 18 (the last Edge prior to it switching to Chromium)
  • Internet Explorer 11 and 8 (via emulation in 11's dev tools)
  • Safari on iOS
  • Chrome on Android

Accessibility

  • Keyboard friendly (navigable with tab, space, enter, arrow keys, etc.)
  • Screen reader friendly
  • Does not introduce new errors or warnings in WAVE

Other

  • Is useable without CSS
  • Is useable without JS
  • Does not introduce new lint warnings
  • Flexible from small to large screens

@contolini
Copy link
Member Author

@wpears I know you're currently trapped in the Sierras waiting for a helicopter evacuation but if you could please review this PR before your cell dies I'd appreciate it thx.

Copy link
Member

@wpears wpears left a comment

Choose a reason for hiding this comment

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

🔥

@contolini contolini merged commit d7aad3c into main Sep 17, 2020
@contolini contolini deleted the a11y-filters branch September 17, 2020 17:01
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