fix(frontend,core): prevent scrolling when using arrow keys to move nodes (#1698)
* fix(frontend,core): prevent scrolling when using arrow keys to move nodes Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add 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:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vue-flow/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Prevent page scroll when using arrow keys to move nodes.
|
||||||
@@ -408,6 +408,9 @@ const NodeWrapper = defineComponent({
|
|||||||
nodeElement.value!,
|
nodeElement.value!,
|
||||||
)
|
)
|
||||||
} else if (isDraggable.value && node.selected && arrowKeyDiffs[event.key]) {
|
} else if (isDraggable.value && node.selected && arrowKeyDiffs[event.key]) {
|
||||||
|
// prevent page scrolling
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
ariaLiveMessage.value = `Moved selected node ${event.key.replace('Arrow', '').toLowerCase()}. New position, x: ${~~node
|
ariaLiveMessage.value = `Moved selected node ${event.key.replace('Arrow', '').toLowerCase()}. New position, x: ${~~node
|
||||||
.position.x}, y: ${~~node.position.y}`
|
.position.x}, y: ${~~node.position.y}`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user