fix(select): prevent clearing form values on reset by ignoring empty selections

This commit is contained in:
Mauricio Siu
2026-10-22 11:12:32 -06:00
parent f2685081d8
commit 3fd1fe1b85
-3
View File
@@ -10,9 +10,6 @@ function Select({
return (
<SelectPrimitive.Root
data-slot="select"
// Radix's hidden native <select> emits "" when the value is set before
// the options mount (e.g. form.reset), wiping the field. Items can't have
// an empty value, so "" is never a real selection.
onValueChange={(value) => {
if (value !== "") onValueChange?.(value);
}}