mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 22:38:49 +01:00
This commit is contained in:
parent
cfc3fd11e9
commit
339329fb6b
1 changed files with 2 additions and 1 deletions
|
|
@ -395,6 +395,8 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
|||
if (hasScrollTop) {
|
||||
protyle.contentElement.scrollTop = scrollAttr.scrollTop;
|
||||
}
|
||||
// 下一个请求过来前需断开,否则 observerLoad 重新赋值后无法 disconnect https://ld246.com/article/1704612002446
|
||||
protyle.observerLoad?.disconnect();
|
||||
if (action.includes(Constants.CB_GET_FOCUS) || action.includes(Constants.CB_GET_SCROLL) || action.includes(Constants.CB_GET_HL) || action.includes(Constants.CB_GET_FOCUSFIRST)) {
|
||||
const contentRect = protyle.contentElement.getBoundingClientRect();
|
||||
const focusRect = focusElement.getBoundingClientRect();
|
||||
|
|
@ -402,7 +404,6 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
|||
scrollCenter(protyle, focusElement, true);
|
||||
}
|
||||
} else {
|
||||
protyle.observerLoad?.disconnect();
|
||||
return;
|
||||
}
|
||||
// 加强定位
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue