diff --git a/.changeset/pink-bees-lick.md b/.changeset/pink-bees-lick.md new file mode 100644 index 000000000..bc4cefd62 --- /dev/null +++ b/.changeset/pink-bees-lick.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Use position instead of computedPosition as updated position when moving a child node via keyboard. diff --git a/packages/core/src/composables/useUpdateNodePositions.ts b/packages/core/src/composables/useUpdateNodePositions.ts index 23e3416f0..c65206500 100644 --- a/packages/core/src/composables/useUpdateNodePositions.ts +++ b/packages/core/src/composables/useUpdateNodePositions.ts @@ -26,7 +26,7 @@ export function useUpdateNodePositions() { if (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined')) { const nextPosition = { x: node.computedPosition.x + positionDiffX, y: node.computedPosition.y + positionDiffY } - const { computedPosition } = calcNextPosition( + const { position } = calcNextPosition( node, nextPosition, emits.error, @@ -36,7 +36,7 @@ export function useUpdateNodePositions() { nodeUpdates.push({ id: node.id, - position: computedPosition, + position, from: node.position, distance: { x: positionDiff.x, y: positionDiff.y }, dimensions: node.dimensions,