浏览代码

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 );