diff --git a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts index f629d1feb0d..740af8e121f 100644 --- a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts +++ b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts @@ -782,8 +782,14 @@ export function applyTableHandlers( const firstCell = firstRow.getFirstChild(); if ( $isTableCellNode(firstCell) && - !$findMatchingParent(anchorCell, (node) => node.is(firstCell)) + tableNode.is( + $findMatchingParent( + anchorCell, + (node) => node.is(tableNode) || node.is(firstCell), + ), + ) ) { + // The selection moved to the table, but not in the first cell firstCell.selectStart(); return true; }