Fixed #2168 - Multiselect with Grouped Data, select all options

pull/2305/head
Tuğçe Küçükoğlu 2022-03-11 14:02:51 +03:00
parent 0d70b500e8
commit deae807804
1 changed files with 9 additions and 2 deletions

View File

@ -560,7 +560,14 @@ export default {
else if (this.visibleOptions) { else if (this.visibleOptions) {
if (this.optionGroupLabel) { if (this.optionGroupLabel) {
value = []; value = [];
this.visibleOptions.forEach(optionGroup => value = [...value, ...this.getOptionGroupChildren(optionGroup)]); if (this.optionGroupLabel) {
value = [];
this.visibleOptions.forEach(optionGroup => {
for (let option of this.getOptionGroupChildren(optionGroup)) {
value.push(this.getOptionValue(option));
}
});
}
} }
else { else {
value = this.visibleOptions.map(option => this.getOptionValue(option)); value = this.visibleOptions.map(option => this.getOptionValue(option));
@ -597,7 +604,7 @@ export default {
} }
}, },
computed: { computed: {
visibleOptions() { visibleOptions() {
if (this.filterValue) { if (this.filterValue) {
if (this.optionGroupLabel) { if (this.optionGroupLabel) {
let filteredGroups = []; let filteredGroups = [];