Skip to content

Commit

Permalink
fix: do not show anyOf validation as select when not an enum list
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Oct 9, 2024
1 parent 954ad1b commit 1b53b72
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/Tune/_Form/FormString.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@ const itemsListbox = computed(() => {
value: item
}));
} else if (props.definition?.anyOf) {
return props.definition.anyOf.map((item: any) => ({
value: item.const,
name: item.title
}));
return props.definition.anyOf
.filter(item => item.const && item.title)
.map((item: any) => ({
value: item.const,
name: item.title
}));
}
return [];
});
</script>

<template>
<TuneListbox
v-if="definition?.enum || definition?.anyOf"
v-if="(definition?.enum || definition?.anyOf) && itemsListbox.length"
ref="textInputRef"
:items="itemsListbox"
:model-value="modelValue"
Expand Down

0 comments on commit 1b53b72

Please sign in to comment.