diff --git a/src/runtime/components/InputMenu.vue b/src/runtime/components/InputMenu.vue index 528cfecb..bd4eb559 100644 --- a/src/runtime/components/InputMenu.vue +++ b/src/runtime/components/InputMenu.vue @@ -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) } diff --git a/src/runtime/components/SelectMenu.vue b/src/runtime/components/SelectMenu.vue index cb45c641..61614f99 100644 --- a/src/runtime/components/SelectMenu.vue +++ b/src/runtime/components/SelectMenu.vue @@ -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) }