Преглед на файлове

MergeCellCommand should update selection before removing table cells.

Maciej Gołaszewski преди 7 години
родител
ревизия
d076abe685
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      packages/ckeditor5-table/src/commands/mergecellscommand.js

+ 4 - 0
packages/ckeditor5-table/src/commands/mergecellscommand.js

@@ -62,6 +62,10 @@ export default class MergeCellsCommand extends Command {
 			tableSelection.clearSelection();
 
 			const firstTableCell = selectedTableCells.shift();
+
+			// TODO: this shouldn't be necessary (right now the selection could overlap existing.
+			writer.setSelection( Range.createIn( firstTableCell ) );
+
 			const { row, column } = tableUtils.getCellLocation( firstTableCell );
 
 			const colspan = parseInt( firstTableCell.getAttribute( 'colspan' ) || 1 );