From b5c80bfa58be30fb24ee8ce97ae620cbd40bbf64 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 17 Jul 2022 11:29:45 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5423 --- app/src/protyle/util/onGet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 44f730470..f8531d7ab 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -107,7 +107,7 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt if (!protyle.wysiwyg.element.querySelector(".protyle-wysiwyg--select") && !protyle.scroll.keepLazyLoad && protyle.contentElement.scrollHeight > REMOVED_OVER_HEIGHT) { let removeElement = protyle.wysiwyg.element.firstElementChild as HTMLElement; const removeElements = []; - while (protyle.wysiwyg.element.childElementCount > 2) { + while (protyle.wysiwyg.element.childElementCount > 2 && removeElements && !protyle.wysiwyg.element.lastElementChild.isSameNode(removeElement)) { if (protyle.contentElement.scrollHeight - removeElement.offsetTop > REMOVED_OVER_HEIGHT) { removeElements.push(removeElement); } else {