mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
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:
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user