fix: fix number convert when string empty

This commit is contained in:
AprilNEA
2024-09-30 08:35:49 +00:00
parent 0b2b20caeb
commit c1c5fc978b
4 changed files with 41 additions and 28 deletions
@@ -18,7 +18,7 @@ import {
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Input, NumberInput } from "@/components/ui/input";
import {
Select,
SelectContent,
@@ -364,12 +364,9 @@ export const AddDomainCompose = ({
<FormItem>
<FormLabel>Container Port</FormLabel>
<FormControl>
<Input
<NumberInput
placeholder={"3000"}
{...field}
onChange={(e) => {
field.onChange(Number.parseInt(e.target.value));
}}
/>
</FormControl>
<FormMessage />