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

DT-2629 - fix multiselect combobox a11y #2520

Merged
merged 3 commits into from
Jan 27, 2025
Merged

Conversation

rossedfort
Copy link
Contributor

@rossedfort rossedfort commented Jan 27, 2025

Description & motivation 💭

When we added multiselect functionality to <Combobox />, we added a checkbox inside of <MenuItem />, which has role="option". This caused an a11y error where there were nested interactive controls, as role="option" makes an element interactive in a listbox. This PR solves the a11y issue by removing the checkbox and using our native <MenuItem />'s selected prop to show a static checkmark and highlighted text. I preferred the look of the checkboxes in the menu items, but I don't know if there's a way to retain that and keep the component accessible.

Context: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/option_role

Screenshots (if applicable) 📸

before after
Screenshot 2025-01-27 at 11 03 04 AM Screenshot 2025-01-27 at 11 57 49 AM
Screenshot 2025-01-27 at 11 58 20 AM

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 7:00pm

@rossedfort rossedfort merged commit ae1344f into main Jan 27, 2025
15 checks passed
@rossedfort rossedfort deleted the DT-2629-combobox-a11y branch January 27, 2025 19:10
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