mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 22:44:06 +01:00
This commit is contained in:
parent
f5ff8f74c2
commit
07aa1e077c
4 changed files with 14 additions and 8 deletions
|
|
@ -63,7 +63,7 @@ export const scrollCenter = (protyle: IProtyle, nodeElement?: Element, top = fal
|
|||
|
||||
let offsetTop = 0;
|
||||
let parentNodeElement = nodeElement;
|
||||
while (!parentNodeElement.classList.contains("protyle-wysiwyg")) {
|
||||
while (parentNodeElement && !parentNodeElement.classList.contains("protyle-wysiwyg")) {
|
||||
offsetTop += (parentNodeElement as HTMLElement).offsetTop;
|
||||
parentNodeElement = parentNodeElement.parentElement;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue