mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
revert commit from #1513
This commit is contained in:
parent
7cb184dc97
commit
3cdf4c426c
@ -39,7 +39,7 @@ const NumberInput = React.forwardRef<HTMLInputElement, InputProps>(
|
|||||||
className={cn("text-left", className)}
|
className={cn("text-left", className)}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
{...props}
|
{...props}
|
||||||
value={props.value === undefined || props.value === "" ? "" : String(props.value)}
|
value={props.value === undefined ? undefined : String(props.value)}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
if (value === "") {
|
if (value === "") {
|
||||||
@ -60,21 +60,6 @@ const NumberInput = React.forwardRef<HTMLInputElement, InputProps>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onBlur={(e) => {
|
|
||||||
// If input is empty, make 0 when focus is lost
|
|
||||||
if (e.target.value === "") {
|
|
||||||
const syntheticEvent = {
|
|
||||||
...e,
|
|
||||||
target: {
|
|
||||||
...e.target,
|
|
||||||
value: "0",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
props.onChange?.(
|
|
||||||
syntheticEvent as unknown as React.ChangeEvent<HTMLInputElement>,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user