From ed908b2330ce59728d93b216e908a0f404895cf0 Mon Sep 17 00:00:00 2001 From: dohyeons Date: Wed, 1 Oct 2025 18:10:29 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=96=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/contexts/ReportDesignerContext.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/contexts/ReportDesignerContext.tsx b/frontend/contexts/ReportDesignerContext.tsx index 7d0af59a..95eb564a 100644 --- a/frontend/contexts/ReportDesignerContext.tsx +++ b/frontend/contexts/ReportDesignerContext.tsx @@ -783,7 +783,8 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin setComponents((prev) => prev.map((c) => { if (idsToUpdate.includes(c.id)) { - return { ...c, zIndex: minZIndex - 1 }; + // zIndex는 최소 1로 제한 (0이면 캔버스 배경 뒤로 가버림) + return { ...c, zIndex: Math.max(1, minZIndex - 1) }; } return c; }), @@ -821,11 +822,12 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin setComponents((prev) => { const sorted = [...prev].sort((a, b) => a.zIndex - b.zIndex); - const updated = sorted.map((c, index) => ({ ...c, zIndex: index })); + const updated = sorted.map((c, index) => ({ ...c, zIndex: index + 1 })); return updated.map((c) => { if (idsToUpdate.includes(c.id)) { - return { ...c, zIndex: Math.max(c.zIndex - 1, 0) }; + // zIndex는 최소 1로 제한 + return { ...c, zIndex: Math.max(c.zIndex - 1, 1) }; } return c; });