fix: updateComponentProperty에서 gridColumns 관련 자동 크기 조정 제거

- 문제: 속성 패널에서 너비를 입력해도 화면에 반영되지 않음
- 원인: updateComponentProperty에서 gridColumns 변경 시 자동으로 너비를 재계산
- 해결:
  1. gridColumns 변경 시 updateSizeFromGridColumns 호출 제거
  2. gridColumns 변경 시 calculateWidthFromColumns 호출 제거
- 영향:
  - 속성 패널에서 입력한 너비가 화면에 즉시 반영됨
  - gridColumns는 더 이상 너비를 자동으로 조정하지 않음
This commit is contained in:
kjs 2025-11-10 15:58:56 +09:00
parent 2148e8e019
commit 8e74429a83
1 changed files with 24 additions and 25 deletions

View File

@ -521,11 +521,11 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD
const finalKey = pathParts[pathParts.length - 1]; const finalKey = pathParts[pathParts.length - 1];
current[finalKey] = value; current[finalKey] = value;
// gridColumns 변경 시 크기 자동 업데이트 // gridColumns 변경 시 크기 자동 업데이트 제거 (격자 시스템 제거됨)
if (path === "gridColumns" && prevLayout.gridSettings) { // if (path === "gridColumns" && prevLayout.gridSettings) {
const updatedSize = updateSizeFromGridColumns(newComp, prevLayout.gridSettings as GridUtilSettings); // const updatedSize = updateSizeFromGridColumns(newComp, prevLayout.gridSettings as GridUtilSettings);
newComp.size = updatedSize; // newComp.size = updatedSize;
} // }
// 크기 변경 시 격자 스냅 적용 제거 (직접 입력 시 불필요) // 크기 변경 시 격자 스냅 적용 제거 (직접 입력 시 불필요)
// 드래그/리사이즈 시에는 별도 로직에서 처리됨 // 드래그/리사이즈 시에는 별도 로직에서 처리됨
@ -557,26 +557,25 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD
// } // }
// } // }
// gridColumns 변경 시 크기를 격자에 맞게 자동 조정 // gridColumns 변경 시 크기를 격자에 맞게 자동 조정 제거 (격자 시스템 제거됨)
if (path === "gridColumns" && prevLayout.gridSettings?.snapToGrid && newComp.type !== "group") { // if (path === "gridColumns" && prevLayout.gridSettings?.snapToGrid && newComp.type !== "group") {
const currentGridInfo = calculateGridInfo(screenResolution.width, screenResolution.height, { // const currentGridInfo = calculateGridInfo(screenResolution.width, screenResolution.height, {
columns: prevLayout.gridSettings.columns, // columns: prevLayout.gridSettings.columns,
gap: prevLayout.gridSettings.gap, // gap: prevLayout.gridSettings.gap,
padding: prevLayout.gridSettings.padding, // padding: prevLayout.gridSettings.padding,
snapToGrid: prevLayout.gridSettings.snapToGrid || false, // snapToGrid: prevLayout.gridSettings.snapToGrid || false,
}); // });
//
// gridColumns에 맞는 정확한 너비 계산 // const newWidth = calculateWidthFromColumns(
const newWidth = calculateWidthFromColumns( // newComp.gridColumns,
newComp.gridColumns, // currentGridInfo,
currentGridInfo, // prevLayout.gridSettings as GridUtilSettings,
prevLayout.gridSettings as GridUtilSettings, // );
); // newComp.size = {
newComp.size = { // ...newComp.size,
...newComp.size, // width: newWidth,
width: newWidth, // };
}; // }
}
// 위치 변경 시 격자 스냅 적용 (그룹 내부 컴포넌트 포함) // 위치 변경 시 격자 스냅 적용 (그룹 내부 컴포넌트 포함)
if ( if (