fixed number input

This commit is contained in:
2026-06-10 13:45:13 +02:00
parent 470fe75d86
commit d8e8062990
+8 -6
View File
@@ -72,7 +72,7 @@ export const MainForm = () => {
lastName: "",
email: "",
phoneNumber: "",
tickets: 1,
tickets: 0,
chocolates: false,
companyName: "",
cmpFirstName: "",
@@ -331,12 +331,14 @@ export const MainForm = () => {
<>
<Input
type="number"
value={field.state.value ?? ""}
onBlur={field.handleBlur}
onChange={(e) =>
field.handleChange(Number(e.target.value))
value={
field.state.value === 0 ? "" : field.state.value
}
slotProps={{ input: { min: 1 } }}
onBlur={field.handleBlur}
onChange={(e) => {
const val = e.target.value;
field.handleChange(val === "" ? 0 : Number(val));
}}
variant="soft"
sx={{ borderRadius: "10px" }}
/>