Skip to content

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

:art: Prevent scroll jump on heading expansion (#16307)

Jeffrey Chenfe73dbd78497
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 10e0bc65b7..faa4e0561f 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -399,7 +399,6 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
return;
}
if (operation.action === "unfoldHeading") {
- const scrollTop = protyle.contentElement.scrollTop;
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
item.removeAttribute("fold");
// undo 会走 transaction
@@ -428,8 +427,6 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
highlightRender(protyle.wysiwyg.element);
avRender(protyle.wysiwyg.element, protyle);
blockRender(protyle, protyle.wysiwyg.element);
- protyle.contentElement.scrollTop = scrollTop;
- protyle.scroll.lastScrollTop = scrollTop;
}
return;
}