fix(core): prevent scrolling when using arrow keys to move node selection (#1702)

* fix(core): prevent scrolling when using arrow keys to move node selection

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(changeset): update

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

---------

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2024-12-07 16:39:07 +01:00
parent 04d13551e3
commit 600d1a63fd
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
"@vue-flow/core": patch "@vue-flow/core": patch
--- ---
Prevent page scroll when using arrow keys to move nodes. Prevent default scrolling behavior when using arrow keys to move nodes or a selection.
@@ -47,6 +47,8 @@ function onKeyDown(event: KeyboardEvent) {
} }
if (arrowKeyDiffs[event.key]) { if (arrowKeyDiffs[event.key]) {
event.preventDefault()
updatePositions( updatePositions(
{ {
x: arrowKeyDiffs[event.key].x, x: arrowKeyDiffs[event.key].x,