8
0
Просмотр исходного кода

Use cached table map because modifying table during TableWalker breaks the logic.

Maciej Gołaszewski 5 лет назад
Родитель
Сommit
9f7f8348c6
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      packages/ckeditor5-table/src/tableutils.js

+ 3 - 1
packages/ckeditor5-table/src/tableutils.js

@@ -795,11 +795,13 @@ function moveCellsToRow( table, targetRowIndex, cellsToMove, writer ) {
 		startRow: targetRowIndex,
 		endRow: targetRowIndex
 	} );
+
+	const tableRowMap = [ ...tableWalker ];
 	const row = table.getChild( targetRowIndex );
 
 	let previousCell;
 
-	for ( const { column, cell, isSpanned } of tableWalker ) {
+	for ( const { column, cell, isSpanned } of tableRowMap ) {
 		if ( cellsToMove.has( column ) ) {
 			const { cell: cellToMove, rowspan } = cellsToMove.get( column );