fix: Clear InputLabelType item-id as null instead of empty string (#7950)

This commit is contained in:
Patrick Lehner (he/him)
2026-07-26 23:57:23 +09:00
committed by GitHub
parent f424aa29c2
commit 7fb8e0b1a9

View File

@@ -42,7 +42,7 @@ import { useSearch } from "~/composables/use-search";
const modelValue = defineModel<MultiPurposeLabelSummary | IngredientFood | IngredientUnit | null>({ default: () => null }); const modelValue = defineModel<MultiPurposeLabelSummary | IngredientFood | IngredientUnit | null>({ default: () => null });
// support v-model:item-id binding // support v-model:item-id binding
const itemId = defineModel<string | undefined>("item-id", { default: undefined }); const itemId = defineModel<string | null | undefined>("item-id", { default: undefined });
const props = defineProps({ const props = defineProps({
items: { items: {
@@ -81,7 +81,7 @@ const itemVal = computed({
return modelValue.value; return modelValue.value;
}, },
set: (val) => { set: (val) => {
itemId.value = val?.id || ""; itemId.value = val?.id ?? null;
modelValue.value = val; modelValue.value = val;
}, },
}); });