Skip to content

DT-2629 - fix multiselect combobox a11y#2520

Merged
rossedfort merged 3 commits intomainfrom
DT-2629-combobox-a11y
Jan 27, 2025
Merged

DT-2629 - fix multiselect combobox a11y#2520
rossedfort merged 3 commits intomainfrom
DT-2629-combobox-a11y

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?

@vercel
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
11 checks passed
@rossedfort rossedfort deleted the DT-2629-combobox-a11y branch January 27, 2025 19:10
hferentschik pushed a commit to DataDog/temporalio-ui that referenced this pull request Mar 12, 2026
* fix multiselect combobox a11y

* put the slot back

* better affordance for selected menu item
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