shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.73k stars 993 forks source link

Pre-selected values not selected in the vue-multiselect dropdown #878

Closed PrimozRome closed 6 years ago

PrimozRome commented 6 years ago

Why are my preselected options not selected when I open the select dropdown?

screenshot 2018-11-20 at 15 44 26

This is the value prop of the vue-multiselect - preselected values

screenshot 2018-11-20 at 15 46 56

and this is the options prop

screenshot 2018-11-20 at 15 47 10

What am I missing here? The values should be selected when I open the dropdown correct?

Now what happens is I can select the already preselected option again that was passed into value prop. See here:

screenshot 2018-11-20 at 15 52 24
shentao commented 6 years ago

Matching for objects is based on the property you pass to track-by. Make sure you pass id to track-by.

PrimozRome commented 6 years ago

Matching for objects is based on the property you pass to track-by. Make sure you pass id to track-by.

@shentao uff life saver. Thanks a lot.

shentao commented 6 years ago

No problem. :) Btw. even if an issue is closed, you can still comment.

PrimozRome commented 6 years ago

No problem. :) Btw. even if an issue is closed, you can still comment.

Yeah I know. We use your component a lot. Do you have a donate button somewhere to drop in for few beers?

shentao commented 6 years ago

Whoa! Been thinking about it a while ago and now that you mention I guess I should really consider doing something like https://www.buymeacoffee.com/. Thank you!

PrimozRome commented 6 years ago

Sure you should do it!

OliverGrimsley commented 6 years ago

Damian - I would buy you more than a cup of coffee - if I knew you were getting the $'s - so I encourage you to do it so we have a known good way of donating to you.

shentao commented 6 years ago

Thank you a lot! This is really encouraging to hear. 😃 Will work on it around December and let you both know.