Skip to content

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

fix: 动态加载时编辑器抖动 (#13983)

Jeffrey Chen8018d54f8ad8
diff --git a/app/src/protyle/scroll/event.ts b/app/src/protyle/scroll/event.ts
index 943c417e9d..4113cd54b5 100644
--- a/app/src/protyle/scroll/event.ts
+++ b/app/src/protyle/scroll/event.ts
@@ -71,7 +71,7 @@ export const scrollEvent = (protyle: IProtyle, element: HTMLElement) => {
if (element.scrollTop < element.clientHeight &&
protyle.wysiwyg.element.firstElementChild.getAttribute("data-eof") !== "1") {
// 禁用滚动时会产生抖动 https://ld246.com/article/1666717094418
- protyle.contentElement.style.width = (protyle.contentElement.clientWidth) + "px";
+ protyle.contentElement.style.width = (protyle.contentElement.offsetWidth) + "px";
protyle.contentElement.style.overflow = "hidden";
protyle.wysiwyg.element.setAttribute("data-top", element.scrollTop.toString());
fetchPost("/api/filetree/getDoc", {