Skip to content

[combobox] Fix controlled value prop when items change - #3607

Merged
atomiks merged 1 commit into
mui:masterfrom
atomiks:fix/combobox-items-change
Dec 28, 2025
Merged

atomiks merged 1 commit into
mui:masterfrom
atomiks:fix/combobox-items-change

Conversation

@atomiks

@atomiks atomiks commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

The value gets cleared if the items change and the selected value is no longer in it; in controlled mode, this wasn't synchronized properly since it bypassed the onValueChange call

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

pkg-pr-new Bot commented Dec 24, 2025 •

Copy link
Copy Markdown
  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@3607
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@3607
    

commit: 4b29dc3

@mui-bot

mui-bot commented Dec 24, 2025 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react ▼-90B(-0.02%) ▼-28B(-0.02%)

Details of bundle changes


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

@netlify

netlify Bot commented Dec 24, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 4b29dc3
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6950c2c094af8a0008a2d141
😎 Deploy Preview https://deploy-preview-3607--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@atomiks
atomiks marked this pull request as ready for review December 24, 2025 05:54
setSelectedValueUnwrapped(fallback);

// Keep the input text in sync when the input is rendered outside the popup.
if (!store.state.inputInsidePopup) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself, this logic for updating the input is already inside the setSelectedValue.

@atomiks
atomiks force-pushed the fix/combobox-items-change branch from 4ebd6e5 to 4b29dc3 Compare December 28, 2025 05:40
@atomiks
atomiks merged commit 2480f69 into mui:master Dec 28, 2025
@atomiks
atomiks deleted the fix/combobox-items-change branch December 28, 2025 05:47
atomiks added a commit to atomiks/base-ui that referenced this pull request Dec 28, 2025
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.

3 participants