From deae80780447a90fc42807f33f5477cbb7f30617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Fri, 11 Mar 2022 14:02:51 +0300 Subject: [PATCH] Fixed #2168 - Multiselect with Grouped Data, select all options --- src/components/multiselect/MultiSelect.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index 0aa6c87f2..b4c7117ca 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -560,7 +560,14 @@ export default { else if (this.visibleOptions) { if (this.optionGroupLabel) { 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 { value = this.visibleOptions.map(option => this.getOptionValue(option)); @@ -597,7 +604,7 @@ export default { } }, computed: { - visibleOptions() { + visibleOptions() { if (this.filterValue) { if (this.optionGroupLabel) { let filteredGroups = [];