diff --git a/src/features/ePocFlow/nodes/ScreenNode.vue b/src/features/ePocFlow/nodes/ScreenNode.vue index 45ef4d94ae13bfa48d76c041be99ff61876c7ef9..65c41d80c7d7d173e6d473e9848d45d380515e8a 100644 --- a/src/features/ePocFlow/nodes/ScreenNode.vue +++ b/src/features/ePocFlow/nodes/ScreenNode.vue @@ -89,7 +89,7 @@ function change(event) { editorStore.changeElementOrder(oldIndex, newIndex, props.id); } if(event.removed) { - editorStore.removeElementFromScreen(event.removed.oldIndex, props.id); + editorStore.removeElementFromScreen(event.removed.oldIndex, props.id, true); } } diff --git a/src/shared/stores/editorStore.ts b/src/shared/stores/editorStore.ts index b448b0a00e2ebf0431aa7aec5e6ed475aff10f4a..5627782a20b12453825a597ae2ecf50aebcf6dfd 100644 --- a/src/shared/stores/editorStore.ts +++ b/src/shared/stores/editorStore.ts @@ -138,12 +138,13 @@ export const useEditorStore = defineStore('editor', { node.data.formValues.components.push({ action: action }); } }, - removeElementFromScreen(index: number, parentNodeId): void { + removeElementFromScreen(index: number, parentNodeId, nodeMoved?: boolean): void { this.closeFormPanel(); const node = findNode(parentNodeId); - + node.data.elements.splice(index, 1); - if(this.openedParentId) { + + if(this.openedParentId || nodeMoved) { node.data.formValues.components.splice(index, 1); }