Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1x 1x 1x 15x 15x 13x 19x 19x 14x 13x 13x | import { collapseTableSelection } from '../selection/collapseTableSelection';
import { getSelectedCells, mutateBlock } from 'roosterjs-content-model-dom';
import type { ShallowMutableContentModelTable } from 'roosterjs-content-model-types';
/**
* @internal
*/
export function deleteTableRow(table: ShallowMutableContentModelTable) {
const sel = getSelectedCells(table);
if (sel) {
table.rows[sel.firstRow].cells.forEach((cell, colIndex) => {
const cellInNextCell = table.rows[sel.lastRow + 1]?.cells[colIndex];
if (cellInNextCell) {
mutateBlock(cellInNextCell).spanAbove = cellInNextCell.spanAbove && cell.spanAbove;
}
});
table.rows.splice(sel.firstRow, sel.lastRow - sel.firstRow + 1);
collapseTableSelection(table.rows, sel);
}
}
|