Skip to content

Commit

Permalink
Bug Fix: Insert paragraph at table's edge inside a collapsible (#6159)
Browse files Browse the repository at this point in the history
  • Loading branch information
serey-roth authored May 21, 2024
1 parent bccb3c0 commit 69161e7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/lexical-table/src/LexicalTableSelectionHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1655,9 +1655,19 @@ function $getTableEdgeCursorPosition(
selection: RangeSelection,
tableNode: TableNode,
) {
const tableNodeParent = tableNode.getParent();
if (!tableNodeParent) {
return undefined;
}

const tableNodeParentDOM = editor.getElementByKey(tableNodeParent.getKey());
if (!tableNodeParentDOM) {
return undefined;
}

// TODO: Add support for nested tables
const domSelection = window.getSelection();
if (!domSelection || domSelection.anchorNode !== editor.getRootElement()) {
if (!domSelection || domSelection.anchorNode !== tableNodeParentDOM) {
return undefined;
}

Expand Down

0 comments on commit 69161e7

Please sign in to comment.