mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(InputMenu/SelectMenu): filter null items in search
This commit is contained in:
@@ -258,8 +258,12 @@ const filteredGroups = computed(() => {
|
||||
|
||||
const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey] as string[]
|
||||
|
||||
return groups.value.map(group => group.filter((item) => {
|
||||
if (typeof item !== 'object' || item === null) {
|
||||
return groups.value.map(items => items.filter((item) => {
|
||||
if (item === undefined || item === null) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof item !== 'object') {
|
||||
return contains(String(item), searchTerm.value)
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +260,11 @@ const filteredGroups = computed(() => {
|
||||
const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey] as string[]
|
||||
|
||||
return groups.value.map(items => items.filter((item) => {
|
||||
if (typeof item !== 'object' || item === null) {
|
||||
if (item === undefined || item === null) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof item !== 'object') {
|
||||
return contains(String(item), searchTerm.value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user