Skip to content

Commit

Permalink
🎨 fix #10746
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 30, 2024
1 parent ff1d59a commit ad68e6c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/menus/protyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {renderAssetsPreview} from "../asset/renderAssets";
import {upDownHint} from "../util/upDownHint";
import {hintRenderAssets} from "../protyle/hint/extend";
import {Menu} from "../plugin/Menu";
import {getFirstBlock} from "../protyle/wysiwyg/getBlock";

const renderAssetList = (element: Element, k: string, position: IPosition, exts: string[] = []) => {
fetchPost("/api/search/searchAsset", {
Expand Down Expand Up @@ -834,8 +835,14 @@ export const zoomOut = (options: {
if (options.focusId) {
const focusElement = options.protyle.wysiwyg.element.querySelector(`[data-node-id="${options.focusId}"]`);
if (focusElement) {
focusBlock(focusElement);
focusElement.scrollIntoView();
// 退出聚焦后块在折叠中 https://github.com/siyuan-note/siyuan/issues/10746
let showElement = focusElement
while (showElement.getBoundingClientRect().height === 0) {
showElement = showElement.parentElement;
}
showElement = getFirstBlock(showElement);
focusBlock(showElement);
showElement.scrollIntoView();
} else if (options.id === options.protyle.block.rootID) { // 聚焦返回后,该块是动态加载的,但是没加载出来
fetchPost("/api/filetree/getDoc", {
id: options.focusId,
Expand Down

0 comments on commit ad68e6c

Please sign in to comment.