From aec54b7b9dc3b3297d61556df1b14e37c3105ffc Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 30 Oct 2024 10:11:57 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/10488 --- app/src/protyle/wysiwyg/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index b2c946b8168..4409f7e8a25 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -437,7 +437,7 @@ export class WYSIWYG { // https://github.com/siyuan-note/siyuan/issues/3026 hideElements(["select"], protyle); } - const target = event.target as HTMLElement; + let target = event.target as HTMLElement; if (hasClosestByClassName(target, "protyle-action") || (hasClosestByClassName(target, "av__cell--header") && !hasClosestByClassName(target, "av__widthdrag"))) { return; @@ -700,6 +700,10 @@ export class WYSIWYG { } // table cell select let tableBlockElement: HTMLElement | false; + const targetCellElemet = hasClosestByMatchTag(target, "TH") || hasClosestByMatchTag(target, "TD") + if (targetCellElemet) { + target = targetCellElemet; + } if (target.tagName === "TH" || target.tagName === "TD" || target.firstElementChild?.tagName === "TABLE" || target.classList.contains("table__resize") || target.classList.contains("table__select")) { tableBlockElement = hasClosestBlock(target); if (tableBlockElement) {