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 <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vue-flow/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Use position instead of computedPosition as updated position when moving a child node via keyboard.
|
||||||
@@ -26,7 +26,7 @@ export function useUpdateNodePositions() {
|
|||||||
if (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined')) {
|
if (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined')) {
|
||||||
const nextPosition = { x: node.computedPosition.x + positionDiffX, y: node.computedPosition.y + positionDiffY }
|
const nextPosition = { x: node.computedPosition.x + positionDiffX, y: node.computedPosition.y + positionDiffY }
|
||||||
|
|
||||||
const { computedPosition } = calcNextPosition(
|
const { position } = calcNextPosition(
|
||||||
node,
|
node,
|
||||||
nextPosition,
|
nextPosition,
|
||||||
emits.error,
|
emits.error,
|
||||||
@@ -36,7 +36,7 @@ export function useUpdateNodePositions() {
|
|||||||
|
|
||||||
nodeUpdates.push({
|
nodeUpdates.push({
|
||||||
id: node.id,
|
id: node.id,
|
||||||
position: computedPosition,
|
position,
|
||||||
from: node.position,
|
from: node.position,
|
||||||
distance: { x: positionDiff.x, y: positionDiff.y },
|
distance: { x: positionDiff.x, y: positionDiff.y },
|
||||||
dimensions: node.dimensions,
|
dimensions: node.dimensions,
|
||||||
|
|||||||
Reference in New Issue
Block a user