Răsfoiți Sursa

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

Maciej Gołaszewski 5 ani în urmă
părinte
comite
9f7f8348c6
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  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,
 		startRow: targetRowIndex,
 		endRow: targetRowIndex
 		endRow: targetRowIndex
 	} );
 	} );
+
+	const tableRowMap = [ ...tableWalker ];
 	const row = table.getChild( targetRowIndex );
 	const row = table.getChild( targetRowIndex );
 
 
 	let previousCell;
 	let previousCell;
 
 
-	for ( const { column, cell, isSpanned } of tableWalker ) {
+	for ( const { column, cell, isSpanned } of tableRowMap ) {
 		if ( cellsToMove.has( column ) ) {
 		if ( cellsToMove.has( column ) ) {
 			const { cell: cellToMove, rowspan } = cellsToMove.get( column );
 			const { cell: cellToMove, rowspan } = cellsToMove.get( column );