Browse Source

:art: https://github.com/siyuan-note/siyuan/issues/11085

Vanessa 1 year ago
parent
commit
808c2b8472
1 changed files with 5 additions and 0 deletions
  1. 5 0
      app/src/protyle/util/table.ts

+ 5 - 0
app/src/protyle/util/table.ts

@@ -5,6 +5,7 @@ import {matchHotKey} from "./hotKey";
 import {isNotCtrl} from "./compatibility";
 import {isNotCtrl} from "./compatibility";
 import {scrollCenter} from "../../util/highlightById";
 import {scrollCenter} from "../../util/highlightById";
 import {insertEmptyBlock} from "../../block/util";
 import {insertEmptyBlock} from "../../block/util";
+import {removeBlock} from "../wysiwyg/remove";
 
 
 const scrollToView = (nodeElement: Element, rowElement: HTMLElement, protyle: IProtyle) => {
 const scrollToView = (nodeElement: Element, rowElement: HTMLElement, protyle: IProtyle) => {
     if (nodeElement.getAttribute("custom-pinthead") === "true") {
     if (nodeElement.getAttribute("custom-pinthead") === "true") {
@@ -230,6 +231,10 @@ export const deleteColumn = (protyle: IProtyle, range: Range, nodeElement: Eleme
         if (sideCellElement.offsetLeft + sideCellElement.clientWidth > nodeElement.firstElementChild.scrollLeft + nodeElement.firstElementChild.clientWidth) {
         if (sideCellElement.offsetLeft + sideCellElement.clientWidth > nodeElement.firstElementChild.scrollLeft + nodeElement.firstElementChild.clientWidth) {
             nodeElement.firstElementChild.scrollLeft = sideCellElement.offsetLeft + sideCellElement.clientWidth - nodeElement.firstElementChild.clientWidth;
             nodeElement.firstElementChild.scrollLeft = sideCellElement.offsetLeft + sideCellElement.clientWidth - nodeElement.firstElementChild.clientWidth;
         }
         }
+    } else {
+        nodeElement.classList.add("protyle-wysiwyg--select");
+        removeBlock(protyle, nodeElement, range, "remove");
+        return;
     }
     }
     const tableElement = nodeElement.querySelector("table");
     const tableElement = nodeElement.querySelector("table");
     for (let i = 0; i < tableElement.rows.length; i++) {
     for (let i = 0; i < tableElement.rows.length; i++) {