Commit 21f6940672e1c692b0f612214233e0f882b940fc
1 parent
73b01ee0
fixed #3817 #3836
Showing
2 changed files
with
7 additions
and
5 deletions
Show diff stats
src/components/select/select-head.vue
src/components/select/select.vue
| ... | ... | @@ -351,7 +351,7 @@ |
| 351 | 351 | }); |
| 352 | 352 | }); |
| 353 | 353 | } |
| 354 | - | |
| 354 | + let hasDefaultSelected = slotOptions.some(option => this.query === option.key); | |
| 355 | 355 | for (let option of slotOptions) { |
| 356 | 356 | |
| 357 | 357 | const cOptions = option.componentOptions; |
| ... | ... | @@ -375,11 +375,13 @@ |
| 375 | 375 | if (cOptions.children.length > 0) selectOptions.push({...option}); |
| 376 | 376 | } else { |
| 377 | 377 | // ignore option if not passing filter |
| 378 | - const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option; | |
| 379 | - if (!optionPassesFilter) continue; | |
| 378 | + if (!hasDefaultSelected) { | |
| 379 | + const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option; | |
| 380 | + if (!optionPassesFilter) continue; | |
| 381 | + } | |
| 380 | 382 | |
| 381 | 383 | optionCounter = optionCounter + 1; |
| 382 | - selectOptions.push(this.processOption(option, selectedValues, optionCounter === currentIndex)); | |
| 384 | + selectOptions.push(this.processOption(option, selectedValues, false)); | |
| 383 | 385 | } |
| 384 | 386 | } |
| 385 | 387 | ... | ... |