From 1b4b4cb20949852d672f778294c1d8a384be901f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 15 Feb 2026 09:45:53 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/16729 --- app/src/protyle/wysiwyg/remove.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts index fe7a4bfe1..a2be02023 100644 --- a/app/src/protyle/wysiwyg/remove.ts +++ b/app/src/protyle/wysiwyg/remove.ts @@ -174,7 +174,9 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang if (sideElement) { if (protyle.block.showAll && sideElement.classList.contains("protyle-wysiwyg") && protyle.wysiwyg.element.childElementCount === 0) { setTimeout(() => { - zoomOut({protyle, id: protyle.block.parent2ID, focusId: protyle.block.parent2ID}); + if (document.contains(protyle.element)) { + zoomOut({protyle, id: protyle.block.parent2ID, focusId: protyle.block.parent2ID}); + } }, Constants.TIMEOUT_INPUT * 2 + 100); } else { if ((sideElement.classList.contains("protyle-wysiwyg") && protyle.wysiwyg.element.childElementCount === 0)) { @@ -250,6 +252,9 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang /// #endif // https://github.com/siyuan-note/siyuan/issues/16767 setTimeout(() => { + if (!document.contains(protyle.element)) { + return; + } if (protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2" && !protyle.scroll.element.classList.contains("fn__none") && protyle.contentElement.scrollHeight - protyle.contentElement.scrollTop < protyle.contentElement.clientHeight * 2