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
This commit is contained in:
ashun
2022-07-08 21:07:27 +08:00
committed by GitHub
parent e73f4788f9
commit 20bdf09ea4

View File

@@ -146,7 +146,7 @@ const useSelect = (props: ExtractPropTypes<typeof SelectProps>, 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) {