From 13ebc39bca6d0d034422c08b4aab2f394d840d8f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 14 Aug 2022 10:50:59 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5630 --- app/src/protyle/scroll/event.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/scroll/event.ts b/app/src/protyle/scroll/event.ts index 7c4ae34d8..054670715 100644 --- a/app/src/protyle/scroll/event.ts +++ b/app/src/protyle/scroll/event.ts @@ -45,8 +45,9 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => { } if (protyle.scroll.lastScrollTop - element.scrollTop > 0) { // up - if (element.scrollTop < element.clientHeight / 2 && + if (element.scrollTop < element.clientHeight && protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") !== "true") { + protyle.contentElement.style.overflow = "hidden"; protyle.wysiwyg.element.setAttribute("data-top", element.scrollTop.toString()); fetchPost("/api/filetree/getDoc", { id: protyle.wysiwyg.element.firstElementChild.getAttribute("data-node-id"), @@ -54,6 +55,7 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => { k: protyle.options.key || "", size: Constants.SIZE_GET, }, getResponse => { + protyle.contentElement.style.overflow = ""; onGet(getResponse, protyle, [Constants.CB_GET_BEFORE, Constants.CB_GET_UNCHANGEID]); }); }