Fix insert image to new inserted table row in playground report error (#5417)

Co-authored-by: frankdiwang <fankdiwang@tencent.com>
This commit is contained in:
frankdiw
2023-12-26 22:21:28 +08:00
committed by GitHub
parent a06b8a12bd
commit 4383af2135
2 changed files with 13 additions and 3 deletions

View File

@ -1442,7 +1442,9 @@ test.describe('Tables', () => {
</th>
</tr>
<tr>
<td class="PlaygroundEditorTheme__tableCell"><br /></td>
<td class="PlaygroundEditorTheme__tableCell">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
</tr>
<tr>
<th

View File

@ -249,7 +249,11 @@ export function $insertTableRow__EXPERIMENTAL(insertAfter = true): void {
for (let i = 0; i < columnCount; i++) {
const {cell, startRow} = focusEndRowMap[i];
if (startRow + cell.__rowSpan - 1 <= focusEndRow) {
newRow.append($createTableCellNode(TableCellHeaderStates.NO_STATUS));
newRow.append(
$createTableCellNode(TableCellHeaderStates.NO_STATUS).append(
$createParagraphNode(),
),
);
} else {
cell.setRowSpan(cell.__rowSpan + 1);
}
@ -266,7 +270,11 @@ export function $insertTableRow__EXPERIMENTAL(insertAfter = true): void {
for (let i = 0; i < columnCount; i++) {
const {cell, startRow} = focusStartRowMap[i];
if (startRow === focusStartRow) {
newRow.append($createTableCellNode(TableCellHeaderStates.NO_STATUS));
newRow.append(
$createTableCellNode(TableCellHeaderStates.NO_STATUS).append(
$createParagraphNode(),
),
);
} else {
cell.setRowSpan(cell.__rowSpan + 1);
}