Преглед изворни кода

Update packages/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js

Co-authored-by: Kuba Niegowski <1232187+niegowski@users.noreply.github.com>
Maciej пре 5 година
родитељ
комит
f6b1327086

+ 2 - 7
packages/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js

@@ -55,13 +55,8 @@ function tableCellRefreshPostFixer( model ) {
 			const currentChildren = tableCell.childCount;
 			const prevChildren = currentChildren - childDiff;
 
-			// Might need refresh if previous children was different from 1. Eg.: it was 2 before, now is 1.
-			if ( currentChildren === 1 && prevChildren !== 1 ) {
-				cellsToRefresh.add( tableCell );
-			}
-
-			// Might need refresh if previous children was 1. Eg.: it was 1 before, now is 5.
-			if ( currentChildren !== 1 && prevChildren === 1 ) {
+			// Might need refresh if previous children was different from 1. Eg.: it was 2 before, now is 1 (or the opposite).
+			if ( currentChildren === 1 || prevChildren === 1 ) {
 				cellsToRefresh.add( tableCell );
 			}
 		}