-
Notifications
You must be signed in to change notification settings - Fork 859
Closed
Labels
Description
Environment
N/A
Is this bug related to Nuxt or Vue?
Nuxt
Version
v3.2.0
Reproduction
https://codesandbox.io/p/devbox/compassionate-jasper-w2k3lm
Description
The InputMenu
component throws an error if one of the fields provided in filterFields
resolved to a nullish or non-string value. You can reproduce this in the sandbox by typing in the input box and observing the console.
So having the following setup errors out, which is a real-world use case I'm encountering this:
<script lang="ts" setup>
const items = [
{
label: 'foo',
alias: 'something'
},
{
label: 'bar'
}
]
</script>
<template>
<UInputMenu :items :filter-fields="['label', 'alias']" />
</template>
This is caused by useFilter.contains
being called with a non-string value.
It is somewhat related to #3606 which has been addressed previously, but only for primitive item types.
Additional context
No response