Browse Source

Pass proper parameters to TableUtils.removeColumns() ins RemoveColumnCommand.

Maciej Gołaszewski 5 years ago
parent
commit
686afd7d3d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packages/ckeditor5-table/src/commands/removecolumncommand.js

+ 4 - 2
packages/ckeditor5-table/src/commands/removecolumncommand.js

@@ -68,9 +68,11 @@ export default class RemoveColumnCommand extends Command {
 			// A temporary workaround to avoid the "model-selection-range-intersects" error.
 			writer.setSelection( writer.createRangeOn( table ) );
 
-			this.editor.plugins.get( 'TableUtils' ).removeColumns( {
+			const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;
+
+			this.editor.plugins.get( 'TableUtils' ).removeColumns( table, {
 				at: removedColumnIndexes.first,
-				columns: removedColumnIndexes.last - removedColumnIndexes.first
+				columns: columnsToRemove
 			} );
 
 			writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );