shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js

Home Page:https://vue-multiselect.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect filter when to deselect a group

dairsposito opened this issue · comments

option => group[this.groupValues].indexOf(option) === -1

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) );