From 3c6e81316027b5c8a15c28ecc4b49b5ba2c23862 Mon Sep 17 00:00:00 2001 From: LIlGG <1103069291@qq.com> Date: Tue, 23 Jan 2024 15:10:29 +0800 Subject: [PATCH] fix: text selected after resolving the table cannot be deleted --- console/packages/editor/src/extensions/table/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;