shentao / vue-multiselect

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

Incorrect filter when to deselect a group #1696

Closed dairsposito closed 10 months ago

dairsposito commented 1 year ago

https://github.com/shentao/vue-multiselect/blob/30667d0e0225dcbb0510dc342e109137a1dcfcab/src/multiselectMixin.js#L567

When selected a group, if you want to deselect all group, it does nothing. That is because the new value returned in this case, its not filtering correctly.

I've solved the problem with the following filter: const newValue = this.internalValue.filter( (option) => !group[this.groupValues] .map((item)=>item.id) .includes(option.id) );