Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/14004

Vanessa05a7690c62be
diff --git a/app/src/protyle/scroll/index.ts b/app/src/protyle/scroll/index.ts
index f1dcd88a01..a70224cd46 100644
--- a/app/src/protyle/scroll/index.ts
+++ b/app/src/protyle/scroll/index.ts
@@ -67,6 +67,7 @@ export class Scroll {
return;
}
protyle.wysiwyg.element.setAttribute("data-top", protyle.wysiwyg.element.scrollTop.toString());
+ protyle.contentElement.style.overflow = "hidden";
fetchPost("/api/filetree/getDoc", {
index: parseInt(this.inputElement.value),
id: protyle.block.parentID,
@@ -78,6 +79,9 @@ export class Scroll {
protyle,
action: [Constants.CB_GET_FOCUSFIRST, Constants.CB_GET_UNCHANGEID],
afterCB: () => {
+ setTimeout(() => {
+ protyle.contentElement.style.overflow = "";
+ }, Constants.TIMEOUT_INPUT); // 需和 onGet 中的 preventScroll 保持一致
showTooltip(this.element.getAttribute("aria-label"), this.element);
}
});
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index 4d43888a5b..9880253017 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -210,7 +210,7 @@ const setHTML = (options: {
if (options.action.includes(Constants.CB_GET_FOCUSFIRST)) {
// settimeout 时间需短一点,否则定位后快速滚动无效
const headerHeight = protyle.wysiwyg.element.offsetTop - 16;
- preventScroll(protyle, headerHeight, 256);
+ preventScroll(protyle, headerHeight, Constants.TIMEOUT_INPUT);
protyle.contentElement.scrollTop = headerHeight;
}
if (options.isSyncing) {