-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
[Bug]: Combobox fast-deep-equal isn't working #1453
Comments
Hey @unpseudocomplique ! Im not quite sure I understood the problem. One thing in your reproduction is wrong is becase You should follow this custom filtering to achieve the custom filtering. |
I have the same issue. When using objects as values and the value object is not entirely equal to the option object it is not marked as selected. Is there a way to use a particular property for the comparison instead of comparing whole objects using isEqual? For example if I want to compare using the
This can happen when loading the initial selected values from the back-end. For the autocomplete we load the options along with a count, but for the initially selected options we omit the count, because it is only relevant in the autocomplete. Minimal reproduction: https://stackblitz.com/edit/nvjkdpeg?file=src%2FApp.vue The option with id |
Environment
Link to minimal reproduction
https://github.com/unpseudocomplique/repro-reka-ui-combobox
Steps to reproduce
having a v-model selected value different from retreived list value
for exemple :
Describe the bug
Selected value would not be reconized because of isEqual, i guess from this line :
radix-vue/packages/radix-vue/src/Combobox/ComboboxRoot.vue
Line 157 in 79e8509
The item isn't marked as selected and it won't be removed on another selection
Expected behavior
Remove if already selected & mark as selected
I guess this would be a default beaviour but would be better if just like the displayed value we can pass a function for comparaison. Like in my case i want almost always to compare mongodb _id
Something like this prop:
key-identifier="_id" or :key-identifier="(item) => item._id" or :comparaison-function="(a,b) => a._id === b._id"
Context & Screenshots (if applicable)
Exemple from my code in adition of the reproduction link :
Log results:
The text was updated successfully, but these errors were encountered: