From 20bdf09ea4c8dd81f6df7e231fa347c990bc5073 Mon Sep 17 00:00:00 2001 From: ashun Date: Fri, 8 Jul 2022 21:07:27 +0800 Subject: [PATCH] fix(components): [select-v2] add null check to filter method (#8537) (#8538) When options of select-v2 contain null value in their label Filterable feature won't work and let the web page get stuck I add null value protection to the method and let it return false when label includes null --- packages/components/select-v2/src/useSelect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/select-v2/src/useSelect.ts b/packages/components/select-v2/src/useSelect.ts index fe240fa982..beb8928ebc 100644 --- a/packages/components/select-v2/src/useSelect.ts +++ b/packages/components/select-v2/src/useSelect.ts @@ -146,7 +146,7 @@ const useSelect = (props: ExtractPropTypes, emit) => { // fill the conditions here. const query = states.inputValue // when query was given, we should test on the label see whether the label contains the given query - const containsQueryString = query ? o.label.includes(query) : true + const containsQueryString = query ? o.label?.includes(query) : true return containsQueryString } if (props.loading) {