Vue-multiselect: Vuex support caveat (skip the deep-cloning)

Created on 13 Nov 2017  路  5Comments  路  Source: shentao/vue-multiselect

I'm using vue-multiselect for a single select from an array of objects used as options.

Both the options and the selected option belong to a Vuex store. I have followed the "Vuex Support" section from documentation.

The thing is: when I change the selected object within the options array, it does not reflect in the selected option, as expected.

This is happening because the selected object is different from the original object. It is a deepClone copy.

I think this should be at least highlighted in that documentation section. I expected to see reactivity intact, but the fact that the selected value is a copy of the original object really surprised me. I will have to search for the object in the original array by ID, in order to commit/dispatch the same object as the selected one. Not a clone.

3.0 enhancement

Most helpful comment

Deep cloning is removed on the current master. Working on the release.

All 5 comments

Yeah. That鈥檚 something I believe we could get rid off in the 3.0 release. Thanks for the suggestion! :)

(updated the issue name)

This behavior really surprised and disappointed me, and I'm not using VueX. Why does this dropdown need to deep clone anything?

That鈥檚 a legacy thing I want to get rid off.

Deep cloning is removed on the current master. Working on the release.

Deep cloning is removed on the current master. Working on the release.

Has this fix been released?
I'm having the same issue with v 2.1.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yaakovp picture yaakovp  路  3Comments

PrimozRome picture PrimozRome  路  3Comments

katranci picture katranci  路  3Comments

bushcode picture bushcode  路  3Comments

hskrishna29 picture hskrishna29  路  3Comments