Skip to content

[combobox][select] Anchor multiple selection to first selected item - #5573

Draft
atomiks wants to merge 2 commits into
mui:masterfrom
atomiks:codex/multiple-selection-anchor
Draft

[combobox][select] Anchor multiple selection to first selected item#5573
atomiks wants to merge 2 commits into
mui:masterfrom
atomiks:codex/multiple-selection-anchor

Conversation

@atomiks

@atomiks atomiks commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Closes #3077
Closes #5549

Decision

Multiple-selection popups continue to open from a selected item. When more than one item is selected, the anchor is the first selected item in rendered order rather than the most recently added value. This follows the single-selection rule and keeps the opening position stable when values are toggled or supplied in a different order.

Changes

  • Use the same rendered-order anchor in Combobox and Select, including individually rendered items and items collections.
  • Preserve the just-selected highlight when a filtered multiple Combobox clears its query.
  • Cover opening, query clearing, scrolling, controlled updates, and reordered value arrays.

Performance

Synthetic Chromium benchmark with 500 rendered items:

Selected Combobox mount Select open
50 20.68 ms → 19.90 ms 26.63 ms → 25.78 ms
250 24.90 ms → 26.66 ms 29.95 ms → 30.21 ms

The extreme 250-selected Combobox case adds 1.76 ms; the other measured scenarios remained within benchmark noise.

@atomiks atomiks added component: select Changes related to the select component. type: expected behavior The current behavior is already the one expected. component: combobox Changes related to the combobox component. labels Aug 26, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

commit: 16c7576

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 26, 2026

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+315B(+0.07%) 🔺+67B(+0.05%)

Details of bundle changes

Performance

Total duration: 1,200.94 ms -95.99 ms(-7.4%) | Renders: 76 (+0) | Paint: 1,942.05 ms -147.34 ms(-7.1%)

Test Duration Renders
Checkbox mount (500 instances) 60.81 ms ▼-18.69 ms(-23.5%) 1 (+0)

14 tests within noise — details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 16c7576
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a8ec2df8754620008286557
😎 Deploy Preview https://deploy-preview-5573--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

component: combobox Changes related to the combobox component. component: select Changes related to the select component. type: expected behavior The current behavior is already the one expected.

Projects

None yet

1 participant