Skip to content

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

:art: https://ld246.com/article/1734018624070

Vanessa45bd7be9771c
diff --git a/app/src/mobile/util/MobileBackFoward.ts b/app/src/mobile/util/MobileBackFoward.ts
index 94abfaa066..07f4816322 100644
--- a/app/src/mobile/util/MobileBackFoward.ts
+++ b/app/src/mobile/util/MobileBackFoward.ts
@@ -18,6 +18,9 @@ const forwardStack: IBackStack[] = [];
const focusStack = (backStack: IBackStack) => {
const protyle = getCurrentEditor().protyle;
+ // 前进后快速后退会导致滚动错位 https://ld246.com/article/1734018624070
+ protyle.observerLoad.disconnect();
+
window.siyuan.storage[Constants.LOCAL_DOCINFO] = {
id: backStack.id,
};
@@ -95,6 +98,10 @@ const focusStack = (backStack: IBackStack) => {
setReadonlyByConfig(protyle, true);
}
protyle.contentElement.scrollTop = backStack.scrollTop;
+ // 等待 av 等加载 https://ld246.com/article/1734018624070
+ setTimeout(() => {
+ protyle.contentElement.scrollTop = backStack.scrollTop;
+ }, Constants.TIMEOUT_LOAD);
});
};
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 25fe7cd477..2d2bb79af7 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -307,7 +307,6 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme
if (contentElement && cellElement.getAttribute("data-dtype") !== "checkbox") {
const keyboardToolbarElement = document.getElementById("keyboardToolbar");
const keyboardH = parseInt(keyboardToolbarElement.getAttribute("data-keyboardheight")) || (window.outerHeight / 2 - 42);
- console.log(keyboardH, window.innerHeight, cellRect.bottom);
if (cellRect.bottom > window.innerHeight - keyboardH - 42) {
contentElement.scrollTop += cellRect.bottom - window.innerHeight + 42 + keyboardH;
} else if (cellRect.top < 110) {