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
@@ -42,7 +42,7 @@ import { useSearch } from "~/composables/use-search";
const modelValue = defineModel<MultiPurposeLabelSummary | IngredientFood | IngredientUnit | null>({ default: () => null });
// 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({
items: {
@@ -81,7 +81,7 @@ const itemVal = computed({
return modelValue.value;
},
set: (val) => {
itemId.value = val?.id || "";
itemId.value = val?.id ?? null;
modelValue.value = val;
},
});