Skip to content

Commit 600d1a6

Browse files
committed
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 <[email protected]> * chore(changeset): update Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]>
1 parent 04d1355 commit 600d1a6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.changeset/clever-eyes-leave.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"@vue-flow/core": patch
33
---
44

5-
Prevent page scroll when using arrow keys to move nodes.
5+
Prevent default scrolling behavior when using arrow keys to move nodes or a selection.

packages/core/src/components/NodesSelection/NodesSelection.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ function onKeyDown(event: KeyboardEvent) {
4747
}
4848
4949
if (arrowKeyDiffs[event.key]) {
50+
event.preventDefault()
51+
5052
updatePositions(
5153
{
5254
x: arrowKeyDiffs[event.key].x,

0 commit comments

Comments
 (0)