BugFix for component size not being saved

This commit is contained in:
navaneeth 2021-04-21 12:07:22 +05:30
parent 4ad4a334f4
commit efc974aba5
2 changed files with 5 additions and 3 deletions

View file

@ -78,7 +78,7 @@ export const DraggableBox = function DraggableBox({ id, title, left, top, width,
onResizeStop(id, width, height, e, direction, ref, d);
}}
>
<div role="DraggableBox" style={isResizing ? { opacity: 0.5 } : { opacity: 1 }}>
<div ref={drag} role="DraggableBox" style={isResizing ? { opacity: 0.5 } : { opacity: 1 }}>
<Box
component={component}

View file

@ -131,13 +131,15 @@ class Editor extends React.Component {
componentDefinitionChanged = (newDefinition) => {
console.log('new component definition', newDefinition);
console.log('app definition', this.state.appDefinition);
debugger
this.setState( {
appDefinition: {
...this.state.appDefinition,
components: {
...this.state.appDefinition.components,
[newDefinition.id]: { component: newDefinition.component }
[newDefinition.id]: {
...this.state.appDefinition.components[newDefinition.id],
component: newDefinition.component
}
}
}
})