From 08a8d8e8c1ad274c3f416caba33e4f95e580e487 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 15 Dec 2023 19:53:18 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/9891 --- app/src/protyle/util/onGet.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 0262c53ee..94ee3ce6c 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -395,6 +395,9 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr focusElement.scrollIntoView(); } else if (scrollAttr && scrollAttr.scrollTop) { protyle.contentElement.scrollTop = scrollAttr.scrollTop; + } else { + protyle.observerLoad?.disconnect(); + return; } // 加强定位 protyle.observerLoad = new ResizeObserver(() => { @@ -409,7 +412,7 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr setTimeout(() => { protyle.observerLoad.disconnect(); protyle.observer.observe(protyle.wysiwyg.element); - }, 1000 * 16); + }, 1000 * 3); if (focusElement.isSameNode(protyle.wysiwyg.element.firstElementChild)) { protyle.observerLoad.disconnect();