Skip to content

[combobox][menu][select] Revert highlightItem imperative action - #5910

Merged
michaldudak merged 2 commits into
mui:masterfrom
michaldudak:claude/revert-pr-5586-ff274e
Oct 7, 2026
Merged

michaldudak merged 2 commits into
mui:masterfrom
michaldudak:claude/revert-pr-5586-ff274e

Conversation

@michaldudak

@michaldudak michaldudak commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Reverts #5586.

Removes the highlightItem() action from the actionsRef of Combobox.Root, Autocomplete.Root, Menu.Root, ContextMenu.Root and Select.Root, along with the exported <Component>.Root.HighlightItemTarget types, the docs sections and the keyboard-shortcuts demos.

This isn't a plain git revert: 23 later commits touched the same files. Each conflict was resolved against current master so that only the feature is removed. Later work that depended on it is removed too:

Kept from #5586 and #5527 because they don't depend on the action:

  • The grid-navigation guard in useListNavigation that skips re-reporting the current highlight when the grid navigator returns an unchanged index, plus its Combobox test. Without it, keys the grid doesn't handle re-fire onItemHighlighted, and inline Autocomplete in grid mode writes the stale item into the input.
  • Three Menu onItemHighlighted tests from [menu] Add filterable menus #5527 that cover syncHighlightedItem (a stale reason after a list change, and the callback being removed and added back). Their setup now uses keyboard and hover instead of highlightItem.

API docs regenerated with pnpm docs:api.

This reverts commit 9d150e4 (mui#5586).

Later changes built on the action are removed with it: the
`'imperative-action'` highlight reason on `onItemHighlighted` for Menu,
Combobox and Autocomplete (mui#5838), the filterable-menu tests and docs
that called `highlightItem()` (mui#5527), and the imperative-source
exception in the Combobox `onNavigate` guard. The inline-list reset
exception from mui#5815 is kept.
@michaldudak michaldudak added component: select Changes related to the select component. component: menu Changes related to the menu component. component: combobox Changes related to the combobox component. labels Oct 7, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

commit: afd86f1

@jjenzz

jjenzz commented Oct 7, 2026

Copy link
Copy Markdown
Member

to those following along: we plan to handle this still, but not as an imperative API so removing it from current release while we resolve this.

@code-infra-dashboard

code-infra-dashboard Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-836B(-0.16%) ▼-219B(-0.13%)

Details of bundle changes

Performance

Total duration: 562.73 ms +58.00 ms(+11.5%) | Renders: 76 (+0) | Paint: 1,007.78 ms +89.12 ms(+9.7%)

Test Duration Renders
Mixed surface mount (app-like density) 52.76 ms 🔺+17.93 ms(+51.5%) 5 (+0)
Select mount (200 instances) 66.14 ms 🔺+15.23 ms(+29.9%) 3 (+0)
Tooltip mount (300 contained roots) 25.61 ms 🔺+5.53 ms(+27.5%) 1 (+0)
Combobox type — 500 items, narrows to ~11 (type "Row 25") 18.30 ms 🔺+3.63 ms(+24.7%) 15 (+0)
Combobox open — 500 items 13.72 ms 🔺+3.50 ms(+34.2%) 4 (+0)

…and 2 more (+8 within noise) — details

Metric alarms

Test Metric Change
Mixed surface mount (app-like density) bench:paint 🔺 +28.31 ms
Select mount (200 instances) bench:paint 🔺 +21.31 ms
Combobox open — 500 items bench:paint#combobox-open 🔺 +7.33 ms
Combobox open — 500 items bench:paint 🔺 +7.33 ms

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

@netlify

netlify Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit afd86f1
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6ac6385387bfa9000868b906
😎 Deploy Preview https://deploy-preview-5910--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.

The grid guard in useListNavigation is a standalone fix that mui#5586
shipped, not part of highlightItem. Without it, keys the grid does not
handle re-report the current highlight, which corrupts inline
Autocomplete input in grid mode.

Also keep three onItemHighlighted tests from mui#5527 that cover live
syncHighlightedItem behavior, now set up through keyboard and hover.
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: menu Changes related to the menu component. component: select Changes related to the select component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants