mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
🎨 Prevent scroll jump on heading expansion (#16307)
fix https://github.com/siyuan-note/siyuan/issues/15715
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user