From db5110c26a50506ca054e2e9de973a2863863a2e Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Mon, 21 May 2018 10:49:54 +0200 Subject: [PATCH] Allow wider search pattern for filterable --- src/components/select/select.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index c79bb524..a99fcbfe 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -434,11 +434,15 @@ }; }, - validateOption({elm, propsData}){ + validateOption({children, elm, propsData}){ if (this.queryStringMatchesSelectedOption) return true; + const value = propsData.value; 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 query = this.query.toLowerCase().trim(); return stringValues.toLowerCase().includes(query);