From db78c6a6576a341b37a0ad597dd1a7a81465da88 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 3 Oct 2022 18:24:22 +0800 Subject: [PATCH] :sparkles: fix https://github.com/siyuan-note/siyuan/issues/6017 --- app/src/protyle/wysiwyg/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index f5cc50556..5e5bbf4eb 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1125,7 +1125,7 @@ export class WYSIWYG { return false; } protyle.toolbar.range = getEditorRange(protyle.element); - const types = (target.getAttribute("data-type") || "").split(" "); + const types = protyle.toolbar.getCurrentType(protyle.toolbar.range); if (types.includes("block-ref")) { refMenu(protyle, target); // 阻止 popover @@ -1166,7 +1166,8 @@ export class WYSIWYG { return false; } if (!isNotEditBlock(nodeElement) && - (isMobile() || beforeContextmenuRange && nodeElement.contains(beforeContextmenuRange.startContainer))) { + (isMobile() || event.detail.target || (beforeContextmenuRange && nodeElement.contains(beforeContextmenuRange.startContainer))) + ) { if (!isMobile() || protyle.toolbar?.element.classList.contains("fn__none")) { contentMenu(protyle, nodeElement); window.siyuan.menus.menu.popup({x, y: y + 13, h: 26});