From 3d7158c6f603d5e74c73bc57ed471523c2e776e8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 20 May 2023 21:29:40 +0800 Subject: [PATCH] :art: scrollGetMore --- app/src/protyle/util/onGet.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 01a6a9802..edef270e7 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -180,7 +180,10 @@ const setHTML = (options: { // 使用动态滚动条定位到最后一个块,重启后无法触发滚动事件,需要再次更新 index protyle.scroll.updateIndex(protyle, options.scrollAttr.startId); // https://github.com/siyuan-note/siyuan/issues/8224 - if (protyle.wysiwyg.element.clientHeight - parseInt(protyle.wysiwyg.element.style.paddingBottom) < protyle.contentElement.clientHeight) { + const contentRect = protyle.contentElement.getBoundingClientRect(); + if (protyle.wysiwyg.element.clientHeight - parseInt(protyle.wysiwyg.element.style.paddingBottom) < protyle.contentElement.clientHeight && + protyle.wysiwyg.element.lastElementChild.getBoundingClientRect().bottom < contentRect.bottom && + protyle.wysiwyg.element.firstElementChild.getBoundingClientRect().top > contentRect.top) { showMessage(window.siyuan.languages.scrollGetMore); } }