From fa59235cd2a75190b036b5ffc461e6c847c839ad Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Tue, 9 Dec 2025 09:22:10 +0900 Subject: [PATCH] =?UTF-8?q?fix(split-panel-layout2):=20=EC=A2=8C=EC=B8=A1?= =?UTF-8?q?=20=ED=8C=A8=EB=84=90=20=ED=95=AD=EB=AA=A9=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EC=83=81=ED=83=9C=20=EB=B9=84=EA=B5=90=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - idColumn 자동 감지 로직 추가 (id > dept_code > code 순 폴백) - isSelected 비교 시 객체 동일성 및 undefined 체크 추가 - hierarchyConfig.idColumn 미설정 시에도 정상 동작 --- .../SplitPanelLayout2Component.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx b/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx index 3bdd2015..6415519e 100644 --- a/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx +++ b/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx @@ -812,11 +812,22 @@ export const SplitPanelLayout2Component: React.FC { - const idColumn = config.leftPanel?.hierarchyConfig?.idColumn || "id"; + // ID 컬럼 결정: 설정값 > 데이터에 존재하는 일반적인 ID 컬럼 > 폴백 + const configIdColumn = config.leftPanel?.hierarchyConfig?.idColumn; + const idColumn = configIdColumn || + (item["id"] !== undefined ? "id" : + item["dept_code"] !== undefined ? "dept_code" : + item["code"] !== undefined ? "code" : "id"); const itemId = item[idColumn] ?? `item-${level}-${index}`; const hasChildren = item.children?.length > 0; const isExpanded = expandedItems.has(String(itemId)); - const isSelected = selectedLeftItem && selectedLeftItem[idColumn] === item[idColumn]; + // 선택 상태 확인: 동일한 객체이거나 idColumn 값이 일치해야 함 + const isSelected = selectedLeftItem && ( + selectedLeftItem === item || + (item[idColumn] !== undefined && + selectedLeftItem[idColumn] !== undefined && + selectedLeftItem[idColumn] === item[idColumn]) + ); // displayRow 설정에 따라 컬럼 분류 const displayColumns = config.leftPanel?.displayColumns || [];