From 324bcffee85ce923fe9b9edaa66fd167e8e23165 Mon Sep 17 00:00:00 2001 From: Gabriel Fougeron Date: Thu, 13 Jul 2023 08:32:25 +0200 Subject: [PATCH] prevent scroll in GalleryKeyboardSelect --- choreo_GUI/choreo_GUI.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/choreo_GUI/choreo_GUI.js b/choreo_GUI/choreo_GUI.js index cdc1d2e0..0dc8fdd2 100644 --- a/choreo_GUI/choreo_GUI.js +++ b/choreo_GUI/choreo_GUI.js @@ -2741,7 +2741,7 @@ window.addEventListener("keydown", case 'ArrowRight': case 'ArrowDown': case 'ArrowUp': - GalleryKeyboardSelect(event.code) + GalleryKeyboardSelect(event) break } @@ -2749,8 +2749,9 @@ window.addEventListener("keydown", } ) -function GalleryKeyboardSelect(keycode){ +function GalleryKeyboardSelect(event){ + keycode = event.code // Am I currently in a gallery ? var The_Gallery_View @@ -2774,6 +2775,8 @@ function GalleryKeyboardSelect(keycode){ if (FoundGallery) { + event.preventDefault() + var SelectedNodes = The_Gallery_View.getSelectedNodes() if (SelectedNodes.length == 1) {