-
-
Notifications
You must be signed in to change notification settings - Fork 267
[combobox] Fix stuck filtering with differing stringifiers #3201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
9d908b2 to
bdde984
Compare
bdde984 to
e9c975a
Compare
mj12albert
left a comment
There was a problem hiding this 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',
}
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