diff --git a/components/lib/dropdown/Dropdown.vue b/components/lib/dropdown/Dropdown.vue index 512493d41..edf781ae7 100755 --- a/components/lib/dropdown/Dropdown.vue +++ b/components/lib/dropdown/Dropdown.vue @@ -978,9 +978,10 @@ export default { const filtered = []; optionGroups.forEach((group) => { - const filteredItems = group.items.filter((item) => filteredOptions.includes(item)); + const groupChildren = this.getOptionGroupChildren(group); + const filteredItems = groupChildren.filter((item) => filteredOptions.includes(item)); - if (filteredItems.length > 0) filtered.push({ ...group, items: [...filteredItems] }); + if (filteredItems.length > 0) filtered.push({ ...group, [typeof this.optionGroupChildren === 'string' ? this.optionGroupChildren : 'items']: [...filteredItems] }); }); return this.flatOptions(filtered); diff --git a/components/lib/multiselect/MultiSelect.vue b/components/lib/multiselect/MultiSelect.vue index 9334d8463..eda574102 100755 --- a/components/lib/multiselect/MultiSelect.vue +++ b/components/lib/multiselect/MultiSelect.vue @@ -1093,9 +1093,10 @@ export default { const filtered = []; optionGroups.forEach((group) => { - const filteredItems = group.items.filter((item) => filteredOptions.includes(item)); + const groupChildren = this.getOptionGroupChildren(group); + const filteredItems = groupChildren.filter((item) => filteredOptions.includes(item)); - if (filteredItems.length > 0) filtered.push({ ...group, items: [...filteredItems] }); + if (filteredItems.length > 0) filtered.push({ ...group, [typeof this.optionGroupChildren === 'string' ? this.optionGroupChildren : 'items']: [...filteredItems] }); }); return this.flatOptions(filtered);