diff --git a/frontend/components/pop/designer/types/pop-layout.ts b/frontend/components/pop/designer/types/pop-layout.ts index 1d862438..15e70c65 100644 --- a/frontend/components/pop/designer/types/pop-layout.ts +++ b/frontend/components/pop/designer/types/pop-layout.ts @@ -442,7 +442,8 @@ export function resolveModalWidth( viewportWidth: number, ): number { const preset = sizeConfig?.modeOverrides?.[mode] ?? sizeConfig?.default ?? "md"; - const presetWidth = MODAL_SIZE_PRESETS[preset].width; + const presetEntry = MODAL_SIZE_PRESETS[preset] ?? MODAL_SIZE_PRESETS.md; + const presetWidth = presetEntry.width; // full이면 뷰포트 전체, 아니면 프리셋과 뷰포트 중 작은 값 if (preset === "full") return viewportWidth; return Math.min(presetWidth, viewportWidth); diff --git a/frontend/components/pop/viewer/PopViewerWithModals.tsx b/frontend/components/pop/viewer/PopViewerWithModals.tsx index e8fb1569..8d6e4227 100644 --- a/frontend/components/pop/viewer/PopViewerWithModals.tsx +++ b/frontend/components/pop/viewer/PopViewerWithModals.tsx @@ -11,7 +11,7 @@ "use client"; -import { useState, useCallback, useEffect } from "react"; +import { useState, useCallback, useEffect, useMemo } from "react"; import { Dialog, DialogContent, @@ -65,9 +65,13 @@ export default function PopViewerWithModals({ const { subscribe, publish } = usePopEvent(screenId); // 연결 해석기: layout에 정의된 connections를 이벤트 라우팅으로 변환 + const stableConnections = useMemo( + () => layout.dataFlow?.connections ?? [], + [layout.dataFlow?.connections] + ); useConnectionResolver({ screenId, - connections: layout.dataFlow?.connections || [], + connections: stableConnections, }); // 모달 열기/닫기 이벤트 구독 diff --git a/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx b/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx index e1a33021..380cc103 100644 --- a/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx +++ b/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx @@ -407,7 +407,8 @@ function ModalDialog({ open, onOpenChange, modalConfig, title, onSelect }: Modal setActiveFilterTab(hasFilterTabs ? filterTabs![0] : null); fetchData(); } - }, [open, fetchData, hasFilterTabs, filterTabs]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [open, fetchData, hasFilterTabs]); // 필터링된 행 계산 const filteredRows = useMemo(() => {