From afc792b476b5341cc28a840c0931ddc254d9294f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 2 Mar 2023 18:37:55 +0800 Subject: [PATCH] :sparkles: https://github.com/siyuan-note/siyuan/issues/7536 --- app/src/protyle/util/editorCommonEvent.ts | 2 +- app/src/util/globalShortcut.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 136645371..8e2fc2c54 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -792,7 +792,6 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { hideElements(["gutter"], protyle); const targetClass = targetElement.className.split(" "); - targetElement.classList.remove("dragover__bottom", "dragover__top", "dragover__left", "dragover__right", "protyle-wysiwyg--select"); if (targetElement.className.indexOf("dragover__") === -1) { // 拖拽到属性试图内 transaction(protyle, [{ @@ -808,6 +807,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { }]); return; } + targetElement.classList.remove("dragover__bottom", "dragover__top", "dragover__left", "dragover__right", "protyle-wysiwyg--select"); if (targetElement.parentElement.getAttribute("data-type") === "NodeSuperBlock" && targetElement.parentElement.getAttribute("data-sb-layout") === "col") { if (targetClass.includes("dragover__left") || targetClass.includes("dragover__right")) { diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index a6f4d2531..6656a913b 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -233,7 +233,7 @@ export const globalShortcut = () => { } const target = event.target as Element; - const blockElement = hasClosestBlock(target); + const blockElement = hasClosestByClassName(target, "table"); if (blockElement && blockElement.style.cursor !== "col-resize" && !hasClosestByClassName(blockElement, "protyle-wysiwyg__embed")) { const cellElement = (hasClosestByMatchTag(target, "TH") || hasClosestByMatchTag(target, "TD")) as HTMLTableCellElement; if (cellElement) {