Skip to content

Commit

Permalink
fix: scroll cursor into view when moving with arrows left/right
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Sep 22, 2021
1 parent 352b110 commit 7ffd586
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/components/modes/treemode/TreeMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7ffd586

Please sign in to comment.