Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: fix https://github.com/siyuan-note/siyuan/issues/5395

Vanessa0707389feec3
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index b91bf536e0..f6f3f42a09 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -123,6 +123,8 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
protyle.contentElement.scrollTop = protyle.contentElement.scrollTop + (removeElement.getBoundingClientRect().top - lastRemoveTop);
}
protyle.wysiwyg.element.insertAdjacentHTML("beforeend", options.content);
+ // https://github.com/siyuan-note/siyuan/issues/5395
+ protyle.scroll.lastScrollTop = 0;
} else if (options.action.includes(Constants.CB_GET_BEFORE)) {
preventScroll(protyle);
const lastElement = protyle.wysiwyg.element.firstElementChild as HTMLElement;
@@ -136,6 +138,8 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
protyle.wysiwyg.element.lastElementChild.remove();
}
}
+ // https://github.com/siyuan-note/siyuan/issues/5395
+ protyle.scroll.lastScrollTop = 0;
} else {
protyle.wysiwyg.element.innerHTML = options.content;
}