diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 1dfa241d0..db03aecb6 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2670,7 +2670,7 @@ export class WYSIWYG { /// #if MOBILE mobileBlur = true; activeBlur(); - openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]); + openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL], "start"); /// #else if (event.shiftKey) { openFileById({ @@ -2678,7 +2678,8 @@ export class WYSIWYG { id: refBlockId, position: "bottom", action, - zoomIn + zoomIn, + scrollPosition: "start" }); window.dispatchEvent(new KeyboardEvent("keydown", {key: "Escape"})); } else if (event.altKey) { @@ -2687,7 +2688,8 @@ export class WYSIWYG { id: refBlockId, position: "right", action, - zoomIn + zoomIn, + scrollPosition: "start" }); } else if (ctrlIsPressed) { openFileById({ @@ -2695,14 +2697,16 @@ export class WYSIWYG { id: refBlockId, keepCursor: true, action: zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL], - zoomIn + zoomIn, + scrollPosition: "start" }); } else { openFileById({ app: protyle.app, id: refBlockId, action, - zoomIn + zoomIn, + scrollPosition: "start" }); } /// #endif diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index c5a348526..1904a805f 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -1960,7 +1960,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { app: protyle.app, id, action, - zoomIn + zoomIn, + scrollPosition: "start" }); }); event.preventDefault(); @@ -1974,7 +1975,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { id, action: zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL], keepCursor: true, - zoomIn + zoomIn, + scrollPosition: "start" }); }); event.preventDefault(); @@ -1990,7 +1992,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { id, position: "right", action, - zoomIn + zoomIn, + scrollPosition: "start" }); }); event.preventDefault(); @@ -2006,7 +2009,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { id, position: "bottom", action, - zoomIn + zoomIn, + scrollPosition: "start" }); }); event.preventDefault();