diff --git a/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx b/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx index 7e3f7c52f..512b0be19 100644 --- a/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx @@ -5,6 +5,7 @@ */ "use client" +import { useCallback, useRef } from "react"; import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/dashboard"; import { downloadExcelFormat, filePickedBlobArray, UITab, UiTable } from "@common/business_components/ui"; @@ -121,6 +122,21 @@ export default function ProcessFacilityInfoModal(props: ModalType) { const upHeadListPlanInfoChange = headMakeList(upHeadListPlanInfo, 2); const upHeadListFcltyHistInfoChange = headMakeList(upHeadListFcltyHistInfo, 3); const upHeadListFcltyWaterQltyInfoChange = headMakeList(upHeadListFcltyWaterQltyInfo, 4); + const historyTopScrollRef = useRef(null); + const historyBottomScrollRef = useRef(null); + const syncLockRef = useRef(false); + + const syncScroll = useCallback((source: HTMLDivElement | null, target: HTMLDivElement | null) => { + if (!source || !target || syncLockRef.current) return; + syncLockRef.current = true; + const nextTop = source.scrollTop; + if (target.scrollTop !== nextTop) { + target.scrollTop = nextTop; + } + requestAnimationFrame(() => { + syncLockRef.current = false; + }); + }, []); const excelDownloadPlan = () => { const excelDownList: any[] = []; @@ -218,7 +234,7 @@ export default function ProcessFacilityInfoModal(props: ModalType) {

시설 기본정보

- +
{'시설명'} @@ -262,7 +278,11 @@ export default function ProcessFacilityInfoModal(props: ModalType) { -
+
syncScroll(historyTopScrollRef.current, historyBottomScrollRef.current)} + > @@ -274,7 +294,11 @@ export default function ProcessFacilityInfoModal(props: ModalType) {
-
+
syncScroll(historyBottomScrollRef.current, historyTopScrollRef.current)} + > @@ -292,4 +316,4 @@ export default function ProcessFacilityInfoModal(props: ModalType) {
); -} \ No newline at end of file +}