Skip to content

fix(Select): expose listbox and option roles - #1323

Open
PrajjwalBisht10 wants to merge 1 commit into
ClickHouse:mainfrom
PrajjwalBisht10:fix/select-listbox-roles
Open

PrajjwalBisht10 wants to merge 1 commit into
ClickHouse:mainfrom
PrajjwalBisht10:fix/select-listbox-roles

Conversation

@PrajjwalBisht10

@PrajjwalBisht10 PrajjwalBisht10 commented Nov 22, 2026 •

Copy link
Copy Markdown

Title: fix(Select): expose listbox and option roles

Description

Closes #1314. Select, MultiSelect and CheckboxMultiSelect (all built on InternalSelect) now follow the APG combobox pattern with aria-activedescendant: one Tab stop, and focus stays in the input as it does today.

  • The focused input is a combobox with aria-expanded, aria-controls, aria-autocomplete="list" and aria-activedescendant on the highlighted option. It is named by the Select label.
  • The list is a listbox named by the label, or by the trigger when there is no label. It has aria-multiselectable for MultiSelect and CheckboxMultiSelect.
  • Items are options with an id, aria-selected and aria-disabled. Groups are groups named by their heading.
  • The check icon, the separators and the CheckboxMultiSelect checkbox 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

  • Option ids come from the option's position in the list, because option values can hold characters an id cannot.
  • One existing CheckboxMultiSelect test queried the checkbox by role. The checkbox is now aria-hidden, so the test asserts the options' aria-selected state and still checks that the checkbox renders checked, using { hidden: true }. No assertion was removed.
  • Out of scope, left for follow-ups: the popup dialog still has no accessible name; with search hidden the input is 0px tall, so the visible cue is the highlighted option's style; the trigger's sort icon is read as "sort".

Checklist

  • Breaking changes? (add migration notes in changesets)
  • Visual changes? (specify in changesets)
  • Design review needed?

Contribution

  • Sufficient research before PR
  • Self-reviewed the PR
  • Manually tested the changes (when applies - visual confirmation in Storybook)
  • build and build-storybook work locally
  • Tests and Stories are aligned with the changes

Accessibility

  • Keyboard - every action works with Tab / Enter / Space / Esc; focus is visible and returns to the trigger on close
  • Names — every control has a name that includes its visible label; icon-only controls take aria-label
  • Vision — colors come from tokens, focus ring shows, targets are at least 24×24 px

WCAG 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-multiselectable and aria-activedescendant while 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-activedescendant on the highlighted option). The dropdown is a listbox named from the label or trigger; multi variants set aria-multiselectable. Items are option elements with stable ids, aria-selected, and aria-disabled; groups use role="group" with labelled headings. Check icons, separators, and CheckboxMultiSelect checkboxes are aria-hidden so 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.

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-bot

changeset-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1ae995f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

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

@XOP XOP added enhancement New feature or request a11y Accessibility improvements labels Nov 26, 2026
@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Chromatic Storybook

Check Status Link
Storybook ✅ 672 stories published Open Storybook
UI Tests ✅ 672 tests unchanged Open build

Built from commit: 1ae995fa527cbb07a99f96e047aab8cd8c91a9f5 · Chromatic run

Statuses as of the end of the run. The build link shows the live review state.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y Accessibility improvements enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Select options have no listbox or option roles, so selected and highlighted state aren't exposed

2 participants