Allow wider search pattern for filterable
This commit is contained in:
parent
bdb26ef7c8
commit
db5110c26a
1 changed files with 6 additions and 2 deletions
|
@ -434,11 +434,15 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
validateOption({elm, propsData}){
|
validateOption({children, elm, propsData}){
|
||||||
if (this.queryStringMatchesSelectedOption) return true;
|
if (this.queryStringMatchesSelectedOption) return true;
|
||||||
|
|
||||||
const value = propsData.value;
|
const value = propsData.value;
|
||||||
const label = propsData.label || '';
|
const label = propsData.label || '';
|
||||||
const textContent = elm && elm.textContent || '';
|
const textContent = (elm && elm.textContent) || (children || []).reduce((str, node) => {
|
||||||
|
const nodeText = node.elm ? node.elm.textContent : node.text;
|
||||||
|
return `${str} ${nodeText}`;
|
||||||
|
}, '') || '';
|
||||||
const stringValues = JSON.stringify([value, label, textContent]);
|
const stringValues = JSON.stringify([value, label, textContent]);
|
||||||
const query = this.query.toLowerCase().trim();
|
const query = this.query.toLowerCase().trim();
|
||||||
return stringValues.toLowerCase().includes(query);
|
return stringValues.toLowerCase().includes(query);
|
||||||
|
|
Loading…
Add table
Reference in a new issue