fix: 화면 편집기에서 버튼 스타일 실시간 반영 문제 해결
**문제:** - 화면 편집기에서 버튼의 스타일(색상, 폰트 등)을 변경해도 실시간으로 반영되지 않음 - 저장 후 실제 화면에서는 정상적으로 보임 **원인:** - ButtonPrimaryComponent에서 isInteractive 모드일 때만 component.style을 적용 - 디자인 모드(isDesignMode)에서는 사용자 정의 스타일이 무시됨 **해결:** - buttonElementStyle에 component.style을 항상 적용하도록 수정 - width/height는 레이아웃 충돌 방지를 위해 제외 유지 - 디자인 모드와 인터랙티브 모드 모두에서 스타일 실시간 반영 **영향:** - 화면 편집기에서 버튼 스타일 변경 시 즉시 미리보기 가능 - 저장하지 않아도 시각적 피드백 제공
This commit is contained in:
parent
35ec16084f
commit
fef2f4a132
|
|
@ -552,8 +552,8 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
||||||
margin: "0",
|
margin: "0",
|
||||||
lineHeight: "1.25",
|
lineHeight: "1.25",
|
||||||
boxShadow: componentConfig.disabled ? "none" : "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
boxShadow: componentConfig.disabled ? "none" : "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
||||||
// isInteractive 모드에서는 사용자 스타일 우선 적용 (width/height 제외)
|
// 디자인 모드와 인터랙티브 모드 모두에서 사용자 스타일 적용 (width/height 제외)
|
||||||
...(isInteractive && component.style ? Object.fromEntries(
|
...(component.style ? Object.fromEntries(
|
||||||
Object.entries(component.style).filter(([key]) => key !== 'width' && key !== 'height')
|
Object.entries(component.style).filter(([key]) => key !== 'width' && key !== 'height')
|
||||||
) : {}),
|
) : {}),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue