From edcd3721549083d7260f6562bf0b090d09c61e4e Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 20 Jul 2023 23:31:45 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8789 --- app/src/boot/globalShortcut.ts | 3 +++ app/src/protyle/wysiwyg/index.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/app/src/boot/globalShortcut.ts b/app/src/boot/globalShortcut.ts index 2ed24de46..d977a960b 100644 --- a/app/src/boot/globalShortcut.ts +++ b/app/src/boot/globalShortcut.ts @@ -111,6 +111,9 @@ export const globalShortcut = (app: App) => { item.classList.remove("protyle-breadcrumb__bar--hide"); }); window.siyuan.hideBreadcrumb = false; + getAllModels().editor.forEach(item => { + item.editor.protyle.breadcrumb.render(item.editor.protyle, true); + }); } if (event.buttons === 0 && // 鼠标按键被按下时不触发 window.siyuan.layout.bottomDock && diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 45c0d2ec3..b96b160d5 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2003,6 +2003,12 @@ export class WYSIWYG { range.selectNodeContents(emptyEditElement); range.collapse(true); focusByRange(range); + // 需等待 range 更新再次进行渲染 + if (protyle.options.render.breadcrumb) { + setTimeout(() => { + protyle.breadcrumb.render(protyle); + }, Constants.TIMEOUT_TRANSITION) + } } else if (lastEditElement) { range.selectNodeContents(lastEditElement); range.collapse(false);