feat: add collapsible option groups to Select and Multiselect#4813
Draft
ernst-dev wants to merge 2 commits into
Draft
feat: add collapsible option groups to Select and Multiselect#4813ernst-dev wants to merge 2 commits into
ernst-dev wants to merge 2 commits into
Conversation
Adds an opt-in `collapsibleGroups` property to Select and Multiselect. When enabled, OptionGroup headers become expand/collapse disclosure controls (aria-expanded, Enter/Space and Left/Right arrow support), and collapsing a group hides its child options. Groups are expanded by default and the behaviour is fully backward compatible when the prop is omitted.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4813 +/- ##
==========================================
- Coverage 97.61% 97.60% -0.01%
==========================================
Files 952 953 +1
Lines 30816 30916 +100
Branches 11318 11355 +37
==========================================
+ Hits 30081 30177 +96
- Misses 688 732 +44
+ Partials 47 7 -40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ernst-dev
had a problem deploying
to
allure-report
July 23, 2026 16:18 — with
GitHub Actions
Failure
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.
Description
Adds an opt-in
collapsibleGroupsproperty to Select and Multiselect. When enabled,OptionGroupheaders become expand/collapse disclosure controls and collapsing a group hides its child options from the dropdown list. Groups are expanded by default and the behaviour is fully backward compatible when the prop is omitted orfalse.Implemented for AWSUI-61684.
What changed
collapsibleGroups?: booleanonBaseSelectProps(inherited by bothSelectandMultiselect).aria-expanded(role="option"when collapsible).Enter/Spacetoggle a group;ArrowRightexpands andArrowLeftcollapses the highlighted header (disclosure keyboard pattern).applyGroupCollapseutility marks parents ascollapsible/expanded, removes children of collapsed groups, and regenerates test indexes so test-utils keep working for the visible subset.optionsarray).enableSelectAllrow are unaffected.Known follow-ups (not in this PR)
virtualScroll) is not yet optimized for collapse; the plain list path is fully supported.aria-expanded+ the group label).How has this been tested?
src/select/__tests__/collapsible-groups.test.tsx(7) andsrc/multiselect/__tests__/collapsible-groups.test.tsx(4) covering default (backward-compatible) rendering,aria-expanded, click and keyboard toggling, child hiding, and that toggling does not alter selection.eslint .→ 0 errors.gulp quick-build→ success.pages/select/collapsible-groups.page.tsx.Related links, issue #, if available: AWSUI-61684 (see mismatch note above)
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
aria-expandedon headers; keyboard (Enter/Space/Arrow) verified.Security
Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.