fixes: moving components via keyboard should update the editor

This commit is contained in:
arpitnath 2024-04-09 22:49:24 +05:30
parent 5d48385d50
commit 291bd29ff9
2 changed files with 5 additions and 1 deletions

View file

@ -189,7 +189,7 @@ export const Container = ({
} else {
const diffState = diff(components, boxes);
if (!_.isEmpty(diffState) && !isOnlyLayoutUpdate(diffState)) {
if (!_.isEmpty(diffState)) {
setBoxes(components);
}
}

View file

@ -1290,7 +1290,9 @@ const EditorComponent = (props) => {
const _appDefinition = JSON.parse(JSON.stringify(appDefinition));
let newComponents = _appDefinition?.pages[currentPageId].components;
const selectedComponents = useEditorStore.getState()?.selectedComponents;
const componentsIds = [];
for (const selectedComponent of selectedComponents) {
componentsIds.push(selectedComponent.id);
let top = newComponents[selectedComponent.id].layouts[currentLayout].top;
let left = newComponents[selectedComponent.id].layouts[currentLayout].left;
const width = newComponents[selectedComponent.id]?.layouts[currentLayout]?.width;
@ -1327,6 +1329,8 @@ const EditorComponent = (props) => {
_appDefinition.pages[currentPageId].components = newComponents;
appDefinitionChanged(_appDefinition, { containerChanges: true, widgetMovedWithKeyboard: true });
// console.log('arpit::', { componentsIds });
// updateComponentsNeedsUpdateOnNextRender(componentsIds);
};
const copyComponents = () =>