From 1e6f19667e1118b0109906ac9d1c336bace128c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Sat, 23 Jan 2021 00:32:43 +0100 Subject: [PATCH] refactoring --- packages/extension-table/src/table.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/extension-table/src/table.ts b/packages/extension-table/src/table.ts index 08f59fb7..ffeb6115 100644 --- a/packages/extension-table/src/table.ts +++ b/packages/extension-table/src/table.ts @@ -148,11 +148,15 @@ export const Table = Node.create({ return true } - if (this.editor.commands.addRowAfter()) { - return this.editor.commands.goToNextCell() + if (!this.editor.can().addRowAfter()) { + return false } - return false + return this.editor + .chain() + .addRowAfter() + .goToNextCell() + .run() }, 'Shift-Tab': () => this.editor.commands.goToPreviousCell(), }