Repository navigation
fix(Select): expose listbox and option roles - #1323
Open
PrajjwalBisht10 wants to merge 1 commit into
Open
PrajjwalBisht10 wants to merge 1 commit into
PrajjwalBisht10 wants to merge 1 commit into
Conversation
Select, MultiSelect and CheckboxMultiSelect now follow the APG combobox pattern with aria-activedescendant: the focused input is a combobox that points at the highlighted option, the list is a listbox named by the label, and items are options with aria-selected and aria-disabled. Groups are named by their heading. The check icon, separators and the CheckboxMultiSelect checkbox are hidden from assistive technology. Closes ClickHouse#1314 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 1ae995f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Chromatic Storybook
Built from commit: Statuses as of the end of the run. The build link shows the live review state. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: fix(Select): expose listbox and option roles
Description
Closes #1314.
Select,MultiSelectandCheckboxMultiSelect(all built onInternalSelect) now follow the APG combobox pattern witharia-activedescendant: one Tab stop, and focus stays in the input as it does today.comboboxwitharia-expanded,aria-controls,aria-autocomplete="list"andaria-activedescendanton the highlighted option. It is named by the Select label.listboxnamed by the label, or by the trigger when there is no label. It hasaria-multiselectableforMultiSelectandCheckboxMultiSelect.options with anid,aria-selectedandaria-disabled. Groups aregroups named by their heading.CheckboxMultiSelectcheckbox are hidden from assistive technology. The option now carries the selected state, and a focusable control no longer sits inside an option.Links and tickets
#1314. Related: #1295.
Good to know
idcannot.CheckboxMultiSelecttest queried the checkbox by role. The checkbox is nowaria-hidden, so the test asserts the options'aria-selectedstate and still checks that the checkbox renders checked, using{ hidden: true }. No assertion was removed.Checklist
Contribution
buildandbuild-storybookwork locallyAccessibility
aria-labelWCAG 2.2 criteria checked: 4.1.2 Name, Role, Value; 1.3.1 Info and Relationships; 2.1.1 Keyboard.
Tested: unit tests for the roles, names,
aria-selected,aria-disabled,aria-multiselectableandaria-activedescendantwhile moving with the arrow keys. [Add: Storybook Accessibility panel result for the Select, MultiSelect and CheckboxMultiSelect stories, and which screen reader and browser you tried.]Not tested: [List anything you did not check, for example NVDA or JAWS.]
Screenshots
[Optional: the Chrome Accessibility pane for an open Select, before and after.]
Note
Low Risk
Accessibility-only semantics on a shared UI primitive; behavior and visuals stay the same and are covered by new unit tests.
Overview
Select, MultiSelect, and CheckboxMultiSelect (via shared
InternalSelect) now follow the APG combobox + listbox pattern so assistive tech gets proper roles and state, with no visual change.The search input is a
combobox(aria-expanded,aria-controls,aria-activedescendanton the highlighted option). The dropdown is alistboxnamed from the label or trigger; multi variants setaria-multiselectable. Items areoptionelements with stable ids,aria-selected, andaria-disabled; groups userole="group"with labelled headings. Check icons, separators, and CheckboxMultiSelect checkboxes arearia-hiddenso selection is announced on the option, not nested controls.Unit tests were added/updated for listbox naming, multi-select state, keyboard highlight via
aria-activedescendant, and hidden decorative elements.Reviewed by Cursor Bugbot for commit 1ae995f. Bugbot is set up for automated code reviews on this repo. Configure here.