-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
fix(VCombobox): filter matching items when opening first time (#21900) #21901
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
fix(VCombobox): filter matching items when opening first time (#21900) #21901
Conversation
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.
When placed side-by-side with VSelect and VAutocomplete, new behavior feels a bit off. - before: I can type 44 (no match) but still re-open full list
- after: list does not appear and it might feel unexpected/broken
The original problem is the difference between typing the value and setting it programmatically. It would be best to target this specifically and leave the rest as-is.
|
Alternative fix: watch(model, value => {
if (!props.multiple && !hasSelectionSlot.value) {
- +search.value = value[0]?.title ?? ''
+ search.value = value[0]?.title ?? ''
}
-})
+}, { immediate: true })Breaks some tests... I don't have time to dig it this week. @jcjp, can you evaluate it? |
519849d to
0a54e33
Compare
I updated the solution, we are running into test issues whenever we try to update the No errors on the test as well, here is the result of the unit test. VCombobox
|
|
Anyway, my suggestion has the same problem as the previous attempt. Menu does not appear when there is no match (e.g. for |
|
I have updated my solution, it seems that the target behavior that we need to replicate is already living in VAutocomplete. Let me know if this works, I also run the test and it passes.
341f40b to
a16a917
Compare
a16a917 to
22d181f
Compare
|
@jcjp, I have added a test against regression (re-opening menu after typing Initially, I wrote those tests to be based on keyboard interactions (Tab » type » Escape » ArrowDown), but it looks like the options are only preserved if the user clicks outside... Clicking on the menu icon, Tab, Escape - all other methods of closing - seem to clear the "search". With your changes, click-outside + reopen aligns with all of the other methods, but I don't think it is a desired behavior... It is a tough battle. If you can make these new tests pass, we could merge it and handle the re-opening inconsistency later. Ideally, it should not matter if the user opens the menu for the first or n-th time with any of the methods. |
b456bce to
4d98b07
Compare
I updated the solution and looks the issue is fixed, thanks for reviewing and adding the test. |
|
Overall, it looks great. Just anticipating a bug report below. RecordingScreencast.from.2025-08-23.19-58-20.webm |
Recording won't load for me. |
|
@johnleider, when the text does not match any of the list options, every 2nd time I open the menu it either shows all options or a "No data available". So I am clicking menu icon to toggle it on/off and it consistently cycles between both of these results. It would be great if we could avoid it. |
|
The video is loading for me now, thank you. |
I fixed the bug but there is a flicker animation happening when we blur the input field, looks annoying let me know if you guys are okay with this.
I will attempt a cleanup. There are too many boolean flags scattered all over the place and it is making the whole thing very brittle. |
|
@jcjp, the last commit has changed quite a lot. |
I did the test manually looks good thank you for your help on the flicker issue! |




Description
fixes: #21900
Markup: