Skip to content

Commit 45bd7be

Browse files
committedDec 13, 2024
1 parent aa36b95 commit 45bd7be

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎app/src/mobile/util/MobileBackFoward.ts

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const forwardStack: IBackStack[] = [];
1818

1919
const focusStack = (backStack: IBackStack) => {
2020
const protyle = getCurrentEditor().protyle;
21+
// 前进后快速后退会导致滚动错位 https://ld246.com/article/1734018624070
22+
protyle.observerLoad.disconnect();
23+
2124
window.siyuan.storage[Constants.LOCAL_DOCINFO] = {
2225
id: backStack.id,
2326
};
@@ -95,6 +98,10 @@ const focusStack = (backStack: IBackStack) => {
9598
setReadonlyByConfig(protyle, true);
9699
}
97100
protyle.contentElement.scrollTop = backStack.scrollTop;
101+
// 等待 av 等加载 https://ld246.com/article/1734018624070
102+
setTimeout(() => {
103+
protyle.contentElement.scrollTop = backStack.scrollTop;
104+
}, Constants.TIMEOUT_LOAD);
98105
});
99106
};
100107

‎app/src/protyle/render/av/cell.ts

-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme
307307
if (contentElement && cellElement.getAttribute("data-dtype") !== "checkbox") {
308308
const keyboardToolbarElement = document.getElementById("keyboardToolbar");
309309
const keyboardH = parseInt(keyboardToolbarElement.getAttribute("data-keyboardheight")) || (window.outerHeight / 2 - 42);
310-
console.log(keyboardH, window.innerHeight, cellRect.bottom);
311310
if (cellRect.bottom > window.innerHeight - keyboardH - 42) {
312311
contentElement.scrollTop += cellRect.bottom - window.innerHeight + 42 + keyboardH;
313312
} else if (cellRect.top < 110) {

0 commit comments

Comments
 (0)
Please sign in to comment.