diff --git a/web/components/top_bar.tsx b/web/components/top_bar.tsx index 174a6c1..83b353b 100644 --- a/web/components/top_bar.tsx +++ b/web/components/top_bar.tsx @@ -30,6 +30,7 @@ export function TopBar({ progressPerc, completer, lhs, + onClick, rhs, }: { pageName?: string; @@ -41,6 +42,7 @@ export function TopBar({ vimMode: boolean; progressPerc?: number; onRename: (newName?: string) => Promise; + onClick: () => void; completer: (context: CompletionContext) => Promise; actionButtons: ActionButton[]; lhs?: ComponentChildren; @@ -77,7 +79,11 @@ export function TopBar({ }, []); return ( -
1 ? "sb-sync-error" : undefined}> +
1 ? "sb-sync-error" : undefined} + onClick={onClick} + > {lhs}
diff --git a/web/editor_ui.tsx b/web/editor_ui.tsx index 0c9bc1c..3940464 100644 --- a/web/editor_ui.tsx +++ b/web/editor_ui.tsx @@ -187,6 +187,9 @@ export class MainUI { darkMode={viewState.uiOptions.darkMode} progressPerc={viewState.progressPerc} completer={editor.miniEditorComplete.bind(editor)} + onClick={() => { + editor.editorView.scrollDOM.scrollTop = 0; + }} onRename={async (newName) => { if (!newName) { // Always move cursor to the start of the page