fix(01-03): use empty string instead of undefined for Select value — prevents controlled/uncontrolled switch

This commit is contained in:
admin committed 2026-06-06 10:38:47 +02:00
1 parent c4588098ca
commit 9d51003ece
1 file changed
+3 -3
+3 -3
View File
@@ -213,7 +213,7 @@ export function PetForm({
control={control}
render={({ field }) => (
<Select
value={field.value || undefined}
value={field.value || ""}
onValueChange={(val) => {
field.onChange(val);
setSelectedSpeciesId(val);
@@ -256,8 +256,8 @@ export function PetForm({
control={control}
render={({ field }) => (
<Select
value={field.value ?? undefined}
onValueChange={(val) => field.onChange(val ?? null)}
value={field.value ?? ""}
onValueChange={(val) => field.onChange(val || null)}
disabled={!selectedSpeciesId}
>
<SelectTrigger