From 3073bbdc18fd969d239025de77ecf812fef9ec0f Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 5 Nov 2025 09:32:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9D=B4=EB=A0=A5=EC=B6=94=EA=B0=80?= =?UTF-8?q?=EC=8B=9C=20=EC=B5=9C=ED=95=98=EB=8B=A8=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EC=9D=B4=EB=8F=99=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ui/form/fcltReg/bdstReg/bdstAdd.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx index 6f76667c8..df5aaca77 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstAdd.tsx @@ -7,7 +7,7 @@ import { formH1Class } from "@/components/lib/class/comClass"; import { safeDate } from "@/components/lib/func/commom"; import { DatePicker, FormField, FormUi, SelectBox } from "@common/business_components"; import { Button, Checkbox, Input } from "@common/components"; -import { useState } from "react"; +import { useRef, useState } from "react"; import { useFieldArray } from "react-hook-form"; export default function BdstAdd({ form, readonly }: { form: any; readonly?: boolean; }) { @@ -21,12 +21,21 @@ export default function BdstAdd({ form, readonly }: { form: any; readonly?: bool control: form?.control, // Provide a fallback to avoid errors }); + const bottomRef = useRef(null); + const plusHist = () => { append({ bdstChgNm: code.chBuCd[0]?.val, archChgPrmsnDt: new Date(), archChgArea: "", }); + + // 새 항목이 렌더링된 후 스크롤 이동 + setTimeout(() => { + if (bottomRef.current) { + bottomRef.current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); + } + }, 100); }; const [selectedIds, setSelectedIds] = useState([]); @@ -142,7 +151,7 @@ export default function BdstAdd({ form, readonly }: { form: any; readonly?: bool ))} -
+
) } \ No newline at end of file