Commit db5110c26a50506ca054e2e9de973a2863863a2e
1 parent
bdb26ef7
Allow wider search pattern for filterable
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
src/components/select/select.vue
| ... | ... | @@ -434,11 +434,15 @@ |
| 434 | 434 | }; |
| 435 | 435 | }, |
| 436 | 436 | |
| 437 | - validateOption({elm, propsData}){ | |
| 437 | + validateOption({children, elm, propsData}){ | |
| 438 | 438 | if (this.queryStringMatchesSelectedOption) return true; |
| 439 | + | |
| 439 | 440 | const value = propsData.value; |
| 440 | 441 | const label = propsData.label || ''; |
| 441 | - const textContent = elm && elm.textContent || ''; | |
| 442 | + const textContent = (elm && elm.textContent) || (children || []).reduce((str, node) => { | |
| 443 | + const nodeText = node.elm ? node.elm.textContent : node.text; | |
| 444 | + return `${str} ${nodeText}`; | |
| 445 | + }, '') || ''; | |
| 442 | 446 | const stringValues = JSON.stringify([value, label, textContent]); |
| 443 | 447 | const query = this.query.toLowerCase().trim(); |
| 444 | 448 | return stringValues.toLowerCase().includes(query); | ... | ... |