]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts
Lexical: Further improvements to table selection and captions
[bookstack] / resources / js / wysiwyg / lexical / table / LexicalTableUtils.ts
index cdbc846584d2a0d20bc5edcae4d773c9214c77e5..bd807d7f993d9cb44f7d25697bc717fff3621eb9 100644 (file)
@@ -35,6 +35,7 @@ import {
   TableRowNode,
 } from './LexicalTableRowNode';
 import {$isTableSelection} from './LexicalTableSelection';
+import {$isCaptionNode} from "@lexical/table/LexicalCaptionNode";
 
 export function $createTableNodeWithDimensions(
   rowCount: number,
@@ -779,7 +780,7 @@ export function $computeTableMapSkipCellCheck(
     return tableMap[row] === undefined || tableMap[row][column] === undefined;
   }
 
-  const gridChildren = grid.getChildren();
+  const gridChildren = grid.getChildren().filter(node => !$isCaptionNode(node));
   for (let i = 0; i < gridChildren.length; i++) {
     const row = gridChildren[i];
     invariant(