Skip to content

[combobox] Release frozen close query when reopening the popup - #5314

Closed
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:claude/exciting-colden-fd94ed
Closed

atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:claude/exciting-colden-fd94ed

Conversation

@atomiks

@atomiks atomiks commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

When a popup with an exit animation closes with a typed query, the query is frozen in closeQuery so the filtered list stays stable during the exit. If the popup is reopened before the exit completes, handleUnmount never runs, and the cleanup in setOpen was gated on inputInsidePopup — so a standard combobox (input outside the popup) reopened with the stale frozen query. Typing to reopen filtered the list by the previous query instead of the live input value until the next keystroke released it (and on 1.6.0, which lacks the in-open release from #5266, the stale filter persists for the entire reopened session).

The fix clears closeQuery on any reopen in setOpen, keeping the input-inside-popup-specific cleanup (resetting queryChangedAfterOpen and the deferred input clear) inside its original gate so that behavior is unchanged.

Adds a Chromium regression test: type a query, close via Enter with no highlighted item, type again during the close animation, and assert the reopened list is filtered by the live input value. The bug has existed since the component was introduced, affecting both single and multiple selection modes with the input outside the popup.

@atomiks atomiks added component: combobox Changes related to the combobox component. type: bug It doesn't behave as expected. labels Jul 23, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

commit: ddf6e51

@code-infra-dashboard

code-infra-dashboard Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+44B(+0.01%) 🔺+17B(+0.01%)

Details of bundle changes

Performance

Total duration: 1,149.69 ms -80.11 ms(-6.5%) | Renders: 78 (+0) | Paint: 1,810.74 ms -146.88 ms(-7.5%)

No significant changes — details


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

@netlify

netlify Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

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

@atomiks
atomiks marked this pull request as ready for review July 23, 2026 03:52
@atomiks
atomiks force-pushed the claude/exciting-colden-fd94ed branch from 9413b22 to ddf6e51 Compare July 29, 2026 05:37
@atomiks

atomiks commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Note

Superseded by #5362, which releases the frozen close query inline in setOpen instead of in an effect. The release lands in the same commit as the open, so the reopened popup never renders with the stale query.

One narrow gap remains: a controlled open prop flipped directly by app code during the exit animation bypasses the release, since setOpen never runs. Not worth an extra effect in shared combobox substrate. Worth revisiting if it's reported.

@atomiks atomiks closed this Aug 7, 2026
@atomiks
atomiks deleted the claude/exciting-colden-fd94ed branch August 11, 2026 03:01
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. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant