From 4347d10dcd10bba4e08ea0432a30b15d48404570 Mon Sep 17 00:00:00 2001 From: Henry Heino Date: Thu, 17 Apr 2025 08:45:18 -0700 Subject: [PATCH] Desktop: Scroll linked-to headers to the top of the editor --- packages/editor/CodeMirror/editorCommands/jumpToHash.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/editor/CodeMirror/editorCommands/jumpToHash.ts b/packages/editor/CodeMirror/editorCommands/jumpToHash.ts index 440158a60b..b6ef0ebe68 100644 --- a/packages/editor/CodeMirror/editorCommands/jumpToHash.ts +++ b/packages/editor/CodeMirror/editorCommands/jumpToHash.ts @@ -72,7 +72,9 @@ const jumpToHash = (view: EditorView, hash: string) => { if (targetLocation !== undefined) { view.dispatch({ selection: EditorSelection.cursor(targetLocation), - scrollIntoView: true, + effects: [ + EditorView.scrollIntoView(targetLocation, { y: 'start' }), + ], }); return true; }