diff --git a/src/app/editor.ts b/src/app/editor.ts index 7260920..0ebb199 100644 --- a/src/app/editor.ts +++ b/src/app/editor.ts @@ -147,7 +147,7 @@ export class Editor implements Displayable { // lintKeymap, ], }); - this.view.dom.addEventListener("focusin", () => this.focus()); + this.view.dom.addEventListener("focusin", () => this.view.dom.scrollIntoView({ behavior: "smooth", })); van.derive(() => { LanguageDescription.matchFilename(languages, file.filePath.val) diff --git a/src/app/editorgrid.ts b/src/app/editorgrid.ts index 07ed3cc..cdb3b7a 100644 --- a/src/app/editorgrid.ts +++ b/src/app/editorgrid.ts @@ -11,6 +11,7 @@ export interface Displayable { setDeleteFunction(del: () => void): void; title(): string; close(): void; + focus(): void; dom: HTMLElement; }