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

[MDCT-2042]: Make dropdown checkbox options accessible #139439

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

braxex
Copy link
Contributor

@braxex braxex commented Aug 23, 2023

Description

The default behavior of a third-party library (react-multi-select-component) was disallowing tabbing through dropdown checkbox options. The solution was to utilize the component's exposed ItemRenderer prop to provide a custom component to render for each dropdown option. In this case, the component to be provided is the exact same as the default component but one major change: it does not set tabIndex={-1}, which allows users to tab to the dropdown checkbox options. Really this just involved:

  1. Copying over the default option component
  2. Converting from TS to JS + PropTypes (sigh)
  3. Removing the tabIndex property

Here's a video of it in action:

clip.mov

Related ticket(s)

MDCT-2042


How to test

  1. Pull down m2042-a11yed-droppies and run locally
  2. Sign in as admin user
  3. Test that users can tab through the dropdown checkbox options with Tab, select/unselect options with Space, unselect dropdowns with Esc, etc.

Important updates


Author checklist

  • I have performed a self-review of my code
  • I have added thorough tests, if necessary
  • I have updated relevant documentation, if necessary

convert to a different template: test → val | val → prod

@codeclimate
Copy link

codeclimate bot commented Aug 23, 2023

Code Climate has analyzed commit bd14c75 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 66.6% (90% is the threshold).

This pull request will bring the total coverage in the repository to 55.6% (0.0% change).

View more on Code Climate.

@braxex braxex merged commit 21846ca into main Aug 23, 2023
14 checks passed
@braxex braxex deleted the m2042-a11yed-droppies branch August 23, 2023 19:25
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