Skip to content

Commit

Permalink
refactor: Trigger editor:resize event after inserting a table column
Browse files Browse the repository at this point in the history
  • Loading branch information
big-camel committed May 24, 2023
1 parent 690c8f2 commit 0cb925c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/table/src/component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,7 @@ class TableComponent<V extends TableValue = TableValue>
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');
Expand All @@ -893,7 +891,7 @@ class TableComponent<V extends TableValue = TableValue>
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);
Expand Down

0 comments on commit 0cb925c

Please sign in to comment.