|
@@ -209,9 +209,6 @@ export function downcastTableHeadingRowsChange( options = {} ) {
|
|
|
renameViewTableCell( tableCell, 'th', conversionApi, asWidget );
|
|
renameViewTableCell( tableCell, 'th', conversionApi, asWidget );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // Cleanup: this will remove any empty section from the view which may happen when moving all rows from a table section.
|
|
|
|
|
- removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
|
|
|
|
|
}
|
|
}
|
|
|
// The head section has shrunk so move rows from <thead> to <tbody>.
|
|
// The head section has shrunk so move rows from <thead> to <tbody>.
|
|
|
else {
|
|
else {
|
|
@@ -234,11 +231,12 @@ export function downcastTableHeadingRowsChange( options = {} ) {
|
|
|
for ( const tableWalkerValue of tableWalker ) {
|
|
for ( const tableWalkerValue of tableWalker ) {
|
|
|
renameViewTableCellIfRequired( tableWalkerValue, tableAttributes, conversionApi, asWidget );
|
|
renameViewTableCellIfRequired( tableWalkerValue, tableAttributes, conversionApi, asWidget );
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // Cleanup: this will remove any empty section from the view which may happen when moving all rows from a table section.
|
|
|
|
|
- removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Cleanup: Ensure that thead & tbody sections are removed if left empty after moving rows. See #6437, #6391.
|
|
|
|
|
+ removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
|
|
|
|
|
+ removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
|
|
|
|
|
+
|
|
|
function isBetween( index, lower, upper ) {
|
|
function isBetween( index, lower, upper ) {
|
|
|
return index > lower && index < upper;
|
|
return index > lower && index < upper;
|
|
|
}
|
|
}
|
|
@@ -308,8 +306,7 @@ export function downcastRemoveRow() {
|
|
|
mapper.unbindViewElement( child );
|
|
mapper.unbindViewElement( child );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Cleanup: Ensure that thead & tbody sections are removed if left empty. See ckeditor/ckeditor5#6437.
|
|
|
|
|
- // This happens if removing a row is associated with changing table's headingRows attribute (removing row from a heading section).
|
|
|
|
|
|
|
+ // Cleanup: Ensure that thead & tbody sections are removed if left empty after removing rows. See #6437, #6391.
|
|
|
removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
|
|
removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
|
|
|
removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
|
|
removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
|
|
|
}, { priority: 'higher' } );
|
|
}, { priority: 'higher' } );
|