From f09be2a0190f344a8e74c53fb87ff63d9f1148f8 Mon Sep 17 00:00:00 2001 From: yu530feng Date: Wed, 23 Nov 2022 23:10:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A8=E6=A0=BC=E4=B8=8B=E6=96=B9?= =?UTF-8?q?=E6=97=A0=E5=BA=8F=E6=9C=89=E5=BA=8F=E5=88=97=E8=A1=A8=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=88=A0=E9=99=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/table-module/src/module/plugin.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/table-module/src/module/plugin.ts b/packages/table-module/src/module/plugin.ts index ec5d4b92a..e6305d046 100644 --- a/packages/table-module/src/module/plugin.ts +++ b/packages/table-module/src/module/plugin.ts @@ -93,9 +93,10 @@ function withTable(editor: T): T { const before = Editor.before(newEditor, selection) // 前一个 location if (before) { const isTableOnBeforeLocation = isTableLocation(newEditor, before) // before 是否是 table - const isTableOnCurSelection = isTableLocation(newEditor, selection) // 当前是否是 table - if (isTableOnBeforeLocation && !isTableOnCurSelection) { - return // 如果当前不是 table ,前面是 table ,则不执行删除。否则会删除 table 最后一个 cell + + // 如果前面是 table, 当前是空 p,则不执行删除。否则会删除 table 最后一个 cell + if (isTableOnBeforeLocation && core.DomEditor.isSelectedEmptyParagraph(newEditor)) { + return } } }