fixed number input
This commit is contained in:
@@ -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" }}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user