diff --git a/projects/common/ui-elements/frame/frame-element.ts b/projects/common/ui-elements/frame/frame-element.ts index ad6618d626ca1e68dbaac2c86df3c43408f4c178..3563f7f4ee9c43351ec60faa97fd352cd965e4ae 100644 --- a/projects/common/ui-elements/frame/frame-element.ts +++ b/projects/common/ui-elements/frame/frame-element.ts @@ -20,14 +20,16 @@ export class FrameElement extends UIElement implements PositionedElement, Surfac constructor(serializedElement: Partial<UIElement>) { super(serializedElement); Object.assign(this, serializedElement); - const newSerializedElement = serializedElement; - if (newSerializedElement.positionProps && newSerializedElement.positionProps.zIndex === undefined) { - newSerializedElement.positionProps.zIndex = -1; + this.positionProps = initPositionedElement(serializedElement); + this.surfaceProps = initSurfaceElement(serializedElement); + + if (serializedElement.zIndex === undefined && + serializedElement.positionProps?.zIndex === undefined) { + this.positionProps.zIndex = -1; } - this.positionProps = initPositionedElement(newSerializedElement); - this.surfaceProps = initSurfaceElement(newSerializedElement); + this.surfaceProps.backgroundColor = - newSerializedElement.surfaceProps?.backgroundColor as string || + serializedElement.surfaceProps?.backgroundColor as string || 'transparent'; } }