Skip to content

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Nov 13, 2025

Fixes #3192

This normalizes the query used for item filtering so that when a single selection combobox reopens and the input still shows the selected label, the query is treated as empty and show the full list again (even if a custom filter uses a different stringifier that makes the combobox thinks it's currently filtering given there isn't a match with the selected value's label). This compares the visible label against the trimmed query with the collator and falls back to unfiltered data before invoking user filters

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

pkg-pr-new bot commented Nov 13, 2025

vite-css-base-ui-example

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

commit: 1f5595f

@mui-bot
Copy link

mui-bot commented Nov 13, 2025

Bundle size report

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

Details of bundle changes


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

@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 1f5595f
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69155443a6484f00089be5d9
😎 Deploy Preview https://deploy-preview-3201--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 force-pushed the fix/combobox-filter-stringifier branch 3 times, most recently from 9d908b2 to bdde984 Compare November 13, 2025 03:27
@atomiks atomiks force-pushed the fix/combobox-filter-stringifier branch from bdde984 to e9c975a Compare November 13, 2025 03:34
@atomiks atomiks marked this pull request as ready for review November 13, 2025 03:49
Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

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

Works nicely now 👍
https://stackblitz.com/edit/ve6npfxd-f1hdlm7u?file=src%2FApp.tsx

This is somewhat common when the dataset can be searchable by the name/label and also some kind of abbreviation/acronyn/code

{
    name: 'Haneda Airport',
    city: 'Tokyo',
    country: 'Japan',
    iso2: 'JP',
    code: 'HND',
  }

@atomiks atomiks merged commit 31fca19 into mui:master Nov 14, 2025
20 checks passed
@atomiks atomiks deleted the fix/combobox-filter-stringifier branch November 14, 2025 10:06
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.

[combobox] Filtered items stuck after making a selection when filtering by multiple obj properties

3 participants