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:
@@ -2,4 +2,4 @@
|
||||
"@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]) {
|
||||
event.preventDefault()
|
||||
|
||||
updatePositions(
|
||||
{
|
||||
x: arrowKeyDiffs[event.key].x,
|
||||
|
||||
Reference in New Issue
Block a user