diff --git a/console/packages/editor/src/extensions/table/index.ts b/console/packages/editor/src/extensions/table/index.ts index 4586257b54..25412ac215 100644 --- a/console/packages/editor/src/extensions/table/index.ts +++ b/console/packages/editor/src/extensions/table/index.ts @@ -394,11 +394,13 @@ const Table = TiptapTable.extend({ 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;