Skip to content

Commit

Permalink
fix: text selected after resolving the table cannot be deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
LIlGG committed Jan 23, 2024
1 parent 9d9b152 commit 3c6e813
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion console/packages/editor/src/extensions/table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,13 @@ const Table = TiptapTable.extend<ExtensionOptions & TableOptions>({
return true;
}

const { selection } = editor.state;
// the node in the current active state is not a table
// and the previous node is a table
if (
!isNodeActive(editor.state, Table.name) &&
hasTableBefore(editor.state)
hasTableBefore(editor.state) &&
selection.empty
) {
editor.commands.selectNodeBackward();
return true;
Expand Down

0 comments on commit 3c6e813

Please sign in to comment.