From 6bafc1b05061f899ff1ad7f46c99d81de992b48c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 7 Dec 2023 23:41:26 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/9839 --- app/src/protyle/wysiwyg/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 922fd0ad0..90ffdba88 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1008,7 +1008,7 @@ export class WYSIWYG { if (range.toString() === "" || window.siyuan.shiftIsPressed // https://ld246.com/article/1650096678723 ) { - if (event.detail === 3) { + if (event.detail > 2) { // table 前或最后一个 cell 三击状态不对 let cursorElement = hasClosestBlock(range.startContainer) as Element; if (cursorElement) { @@ -1031,7 +1031,7 @@ export class WYSIWYG { } const startBlockElement = hasClosestBlock(range.startContainer); let endBlockElement: false | HTMLElement; - if (mouseUpEvent.detail === 3 && range.endContainer.nodeType !== 3 && (range.endContainer as HTMLElement).tagName === "DIV" && range.endOffset === 0) { + if (mouseUpEvent.detail > 2 && range.endContainer.nodeType !== 3 && (range.endContainer as HTMLElement).tagName === "DIV" && range.endOffset === 0) { // 三击选中段落块时,rangeEnd 会在下一个块 if ((range.endContainer as HTMLElement).classList.contains("protyle-attr") && startBlockElement) { // 三击在悬浮层中会选择到 attr https://github.com/siyuan-note/siyuan/issues/4636 @@ -1376,7 +1376,11 @@ export class WYSIWYG { } else { nodeElement.removeAttribute("data-render"); avRender(nodeElement, protyle, () => { - openViewMenu({protyle, blockElement: nodeElement, element: nodeElement.querySelector(".item.item--focus")}); + openViewMenu({ + protyle, + blockElement: nodeElement, + element: nodeElement.querySelector(".item.item--focus") + }); }, avTabHeaderElement.dataset.id); } event.stopPropagation();