You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
having a v-model selected value different from retreived list value
for exemple :
constotherPeople=[{_id: 6,display: 'Jean mich'},{_id: 7,display: 'Jeanette'},{_id: 8,display: 'Jean'},{_id: 9,display: 'Albert roturier'},]// the query here is minimal so this can be very fastconstreactiveList=ref(JSON.parse(JSON.stringify(otherPeople)))constselectedPeople=ref([{
...otherPeople[0],someOtherFieldUsedInjoin: 'dadad'// beacause the join from bdd have this field on inital page load}])
Describe the bug
Selected value would not be reconized because of isEqual, i guess from this line :
const index =modelValue.value.findIndex(i=>isEqual(i, val))
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:
Hey @unpseudocomplique ! Im not quite sure I understood the problem. One thing in your reproduction is wrong is becase filter-function has been deprecated.
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 id property.
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.
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: