This commit is contained in:
vincentfintend 2018-08-27 16:08:13 +08:00
parent 147f23a50b
commit 902a2cf595

View file

@ -355,14 +355,12 @@
});
});
}
let hasDefaultSelected = slotOptions.some(option => this.query === option.key);
for (let option of slotOptions) {
const cOptions = option.componentOptions;
if (!cOptions) continue;
if (cOptions.tag.match(optionGroupRegexp)){
let children = cOptions.children;
// remove filtered children
if (this.filterable){
children = children.filter(
@ -379,11 +377,8 @@
if (cOptions.children.length > 0) selectOptions.push({...option});
} else {
// ignore option if not passing filter
if (!hasDefaultSelected) {
const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
if (!optionPassesFilter) continue;
}
const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
if (!optionPassesFilter) continue;
optionCounter = optionCounter + 1;
selectOptions.push(this.processOption(option, selectedValues, optionCounter === currentIndex));
}