Skip to content

Commit

Permalink
Merge pull request #749 from madeindjs/fix-workflow-drag
Browse files Browse the repository at this point in the history
fix(ui): move only unselected node in worflow
  • Loading branch information
ramedina86 authored Feb 20, 2025
2 parents 9c51b9f + cb38323 commit ef9bf77
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ui/src/components/workflows/WorkflowsWorkflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,19 @@ function moveNode(ev: MouseEvent) {
const translationX = newX - component.x;
const translationY = newY - component.y;
const isMovingNodeSelected = wfbm.selection.value.some(
(c) => c.componentId === nodeId,
);
if (!isMovingNodeSelected) {
// if the user moves a node that is not selected, we don't move other selected nodes
temporaryNodeCoordinates.value = {
...temporaryNodeCoordinates.value,
[nodeId]: { x: newX, y: newY },
};
return;
}
// apply the same vector to other selected components
const otherSelectedComponents = wfbm.selection.value
.map((c) => wf.getComponentById(c.componentId))
Expand Down

0 comments on commit ef9bf77

Please sign in to comment.