From c4fe56bbd5a3c98dd752cbb99d45a3d1233f12ec Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 8 Aug 2022 18:16:18 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/3614 --- app/src/protyle/util/onGet.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 98bf96eea..23c00d592 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -221,8 +221,9 @@ const setHTML = (options: { content: string, action?: string[], unScroll?: boole } } else if (options.action.includes(Constants.CB_GET_FOCUSFIRST) && !options.unScroll) { // settimeout 时间需短一点,否则定位后快速滚动无效 - preventScroll(protyle, 8, 256); - protyle.contentElement.scrollTop = 8; + const headerHeight = protyle.wysiwyg.element.offsetTop - 16; + preventScroll(protyle, headerHeight, 256); + protyle.contentElement.scrollTop = headerHeight; focusBlock(protyle.wysiwyg.element.firstElementChild); /// #if !MOBILE if (!options.action.includes(Constants.CB_GET_UNUNDO)) {