Ver código fonte

fix: can't remove multiple blocks after moved

Ahmad Kholid 3 anos atrás
pai
commit
e6c3beeecb

+ 6 - 1
src/components/newtab/workflow/WorkflowBuilder.vue

@@ -553,7 +553,12 @@ export default {
       if (key !== 'Delete' || isAnInput) return;
       if (key !== 'Delete' || isAnInput) return;
 
 
       selectedElements.forEach(({ id }) => {
       selectedElements.forEach(({ id }) => {
-        editor.value.removeNodeId(`node-${id}`);
+        const nodeId = `node-${id}`;
+        const isNodeExists = document.querySelector(`#${nodeId}`);
+
+        if (!isNodeExists) return;
+
+        editor.value.removeNodeId(nodeId);
       });
       });
 
 
       selectedElements = [];
       selectedElements = [];