Skip to content

Commit

Permalink
Fix row deletion if previous row is empty (#5231)
Browse files Browse the repository at this point in the history
  • Loading branch information
icrosil authored Nov 15, 2023
1 parent 73fc359 commit 67a99e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/lexical-table/src/LexicalTableUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,11 @@ export function $deleteTableColumn__EXPERIMENTAL(): void {

function $moveSelectionToCell(cell: DEPRECATED_GridCellNode): void {
const firstDescendant = cell.getFirstDescendant();
invariant(firstDescendant !== null, 'Unexpected empty cell');
firstDescendant.getParentOrThrow().selectStart();
if (firstDescendant == null) {
cell.selectStart();
} else {
firstDescendant.getParentOrThrow().selectStart();
}
}

function $insertFirst(parent: ElementNode, node: LexicalNode): void {
Expand Down

2 comments on commit 67a99e5

@vercel
Copy link

@vercel vercel bot commented on 67a99e5 Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical-fbopensource.vercel.app
lexicaljs.com
lexical.dev
lexical-git-main-fbopensource.vercel.app
lexicaljs.org
www.lexical.dev

@vercel
Copy link

@vercel vercel bot commented on 67a99e5 Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground.vercel.app
playground.lexical.dev
lexical-playground-git-main-fbopensource.vercel.app
lexical-playground-fbopensource.vercel.app

Please sign in to comment.