Skip to content

Commit 3f6e09a

Browse files
authored
fix(core): use position instead of computedPos as keyboard move pos (#1989)
* fix(core): use position instead of computedPos as keyboard move pos Signed-off-by: braks <[email protected]> * chore(changeset): add --------- Signed-off-by: braks <[email protected]>
1 parent dd6a91f commit 3f6e09a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/pink-bees-lick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-flow/core": patch
3+
---
4+
5+
Use position instead of computedPosition as updated position when moving a child node via keyboard.

packages/core/src/composables/useUpdateNodePositions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function useUpdateNodePositions() {
2626
if (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined')) {
2727
const nextPosition = { x: node.computedPosition.x + positionDiffX, y: node.computedPosition.y + positionDiffY }
2828

29-
const { computedPosition } = calcNextPosition(
29+
const { position } = calcNextPosition(
3030
node,
3131
nextPosition,
3232
emits.error,
@@ -36,7 +36,7 @@ export function useUpdateNodePositions() {
3636

3737
nodeUpdates.push({
3838
id: node.id,
39-
position: computedPosition,
39+
position,
4040
from: node.position,
4141
distance: { x: positionDiff.x, y: positionDiff.y },
4242
dimensions: node.dimensions,

0 commit comments

Comments
 (0)