From 0cb925c09f164af55d5969f62755e843755b75ab Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Wed, 24 May 2023 23:34:39 +0800 Subject: [PATCH] refactor: Trigger editor:resize event after inserting a table column --- plugins/table/src/component/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/table/src/component/index.ts b/plugins/table/src/component/index.ts index a885ffbd..17862b3b 100644 --- a/plugins/table/src/component/index.ts +++ b/plugins/table/src/component/index.ts @@ -881,9 +881,7 @@ class TableComponent this.onChange(); if (this.enableScroll) this.scrollbar?.refresh(); }); - this.command.on('insertCol', () => { - editor.trigger('editor:resize'); - }); + this.conltrollBar.on('sizeChanging', () => { if (this.enableScroll) this.scrollbar?.refresh(); editor.trigger('editor:resize'); @@ -893,7 +891,7 @@ class TableComponent if (action === 'paste') { editor.card.render(this.wrapper); } - if (['splitCell', 'mergeCell'].includes(action)) { + if (['splitCell', 'mergeCell', 'insertCol'].includes(action)) { editor.trigger('editor:resize'); } this.selection.render(action);