chore(selection): cleanup

This commit is contained in:
moklick
2022-12-19 12:22:42 +01:00
parent 1451a73d0e
commit 43a16e61e6
8 changed files with 288 additions and 285 deletions
@@ -41,7 +41,9 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
useEffect(() => {
if (!disableKeyboardA11y) {
nodeRef.current?.focus();
nodeRef.current?.focus({
preventScroll: true,
});
}
}, [disableKeyboardA11y]);
@@ -65,7 +67,11 @@ function NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboar
const onKeyDown = (event: KeyboardEvent) => {
if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
updatePositions(arrowKeyDiffs[event.key]);
updatePositions({
x: arrowKeyDiffs[event.key].x,
y: arrowKeyDiffs[event.key].y,
isShiftPressed: event.shiftKey,
});
}
};