fix(react): prevent default scrolling behavior when node is moved with keypress

This commit is contained in:
braks
2024-12-02 12:29:43 +01:00
parent 616d266523
commit 9458904cbb
2 changed files with 5 additions and 0 deletions
@@ -68,6 +68,8 @@ export function NodesSelection<NodeType extends Node>({
const onKeyDown = (event: KeyboardEvent) => {
if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
event.preventDefault();
moveSelectedNodes({
direction: arrowKeyDiffs[event.key],
factor: event.shiftKey ? 4 : 1,