diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 7623a284d..8366d5a1f 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -912,14 +912,14 @@ export const zoomOut = (options: { data: getResponse, protyle: options.protyle, action: options.id === options.protyle.block.rootID ? [Constants.CB_GET_FOCUS, Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS, Constants.CB_GET_HTML], - afterCB: options.callback + afterCB: options.callback, }); } else { onGet({ data: getResponse, protyle: options.protyle, action: options.id === options.protyle.block.rootID ? [Constants.CB_GET_FOCUS, Constants.CB_GET_HTML, Constants.CB_GET_UNUNDO] : [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS, Constants.CB_GET_UNUNDO, Constants.CB_GET_HTML], - afterCB: options.callback + afterCB: options.callback, }); } // https://github.com/siyuan-note/siyuan/issues/4874 @@ -938,7 +938,13 @@ export const zoomOut = (options: { showElement = getFirstBlock(showElement); } focusBlock(showElement); - showElement.scrollIntoView(); + const resizeObserver = new ResizeObserver(() => { + showElement.scrollIntoView(); + }); + resizeObserver.observe(options.protyle.wysiwyg.element); + setTimeout(() => { + resizeObserver.disconnect(); + }, 1000 * 3); } else if (options.id === options.protyle.block.rootID) { // 聚焦返回后,该块是动态加载的,但是没加载出来 fetchPost("/api/filetree/getDoc", { id: options.focusId,