From 7ffd586fbf50dfec16ac519bdba494e1ae36981e Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Wed, 22 Sep 2021 10:04:16 +0200 Subject: [PATCH] fix: scroll cursor into view when moving with arrows left/right --- src/lib/components/modes/treemode/TreeMode.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/components/modes/treemode/TreeMode.svelte b/src/lib/components/modes/treemode/TreeMode.svelte index 5f7bb1a9..56cded5a 100644 --- a/src/lib/components/modes/treemode/TreeMode.svelte +++ b/src/lib/components/modes/treemode/TreeMode.svelte @@ -1369,12 +1369,16 @@ selection = selection ? getSelectionLeft(json, state, selection, keepAnchorPath, !readOnly) || selection : getInitialSelection(json, state) + + scrollIntoView(selection.focusPath) } if (combo === 'Right' || combo === 'Shift+Right') { event.preventDefault() selection = selection ? getSelectionRight(json, state, selection, keepAnchorPath, !readOnly) || selection : getInitialSelection(json, state) + + scrollIntoView(selection.focusPath) } if (combo === 'Enter' && selection) {