refactor: number 타입 인풋 onChange 방식 변경
This commit is contained in:
@@ -189,13 +189,9 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
|
||||
type="number"
|
||||
min={0}
|
||||
value={boardTemplate?.atflMaxCnt ?? field.value ?? ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(
|
||||
value === "" ? null : parseInt(value),
|
||||
);
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
className="w-[12rem] !text-[1.3rem]"
|
||||
placeholder="최대 개수 입력"
|
||||
disabled={
|
||||
@@ -224,13 +220,9 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
|
||||
value={
|
||||
boardTemplate?.atflMaxFileSz ?? field.value ?? ""
|
||||
}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(
|
||||
value === "" ? null : parseInt(value),
|
||||
);
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
className="w-[12rem] !text-[1.3rem]"
|
||||
placeholder="최대 크기 입력"
|
||||
disabled={
|
||||
|
||||
@@ -124,11 +124,9 @@ function ImageForm({ form, imgSn, ...props }: ImageFormProps) {
|
||||
type="number"
|
||||
min={0}
|
||||
value={field.value ?? ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(parseInt(value));
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
className="w-[12rem] !text-[1.3rem]"
|
||||
placeholder="정렬순서 입력"
|
||||
/>
|
||||
|
||||
@@ -113,11 +113,9 @@ function ModuleForm({ form, authorizationNo, ...props }: BannerFormProps) {
|
||||
type="number"
|
||||
min={0}
|
||||
value={field.value ?? ""}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(parseInt(value));
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
className="w-[12rem] !text-[1.3rem]"
|
||||
placeholder="정렬순서 입력"
|
||||
/>
|
||||
|
||||
@@ -116,11 +116,9 @@ function PopupForm<T extends PopupFormData | PopupUpdateFormData>({
|
||||
value={field.value ?? 0}
|
||||
className="w-[10rem] !text-[1.3rem]"
|
||||
placeholder="너비"
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(parseInt(value));
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
@@ -139,11 +137,9 @@ function PopupForm<T extends PopupFormData | PopupUpdateFormData>({
|
||||
value={field.value ?? 0}
|
||||
className="w-[10rem] !text-[1.3rem]"
|
||||
placeholder="높이"
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(parseInt(value));
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
@@ -168,11 +164,9 @@ function PopupForm<T extends PopupFormData | PopupUpdateFormData>({
|
||||
value={field.value ?? 0}
|
||||
className="w-[10rem] !text-[1.3rem]"
|
||||
placeholder="Left"
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(parseInt(value));
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
@@ -191,11 +185,9 @@ function PopupForm<T extends PopupFormData | PopupUpdateFormData>({
|
||||
value={field.value ?? 0}
|
||||
className="w-[10rem] !text-[1.3rem]"
|
||||
placeholder="Top"
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (isNaN(parseInt(value))) return;
|
||||
field.onChange(parseInt(value));
|
||||
}}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value))
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
</FormItem>
|
||||
|
||||
Reference in New Issue
Block a user