diff --git a/packages/lexical-playground/__tests__/e2e/Tables.spec.mjs b/packages/lexical-playground/__tests__/e2e/Tables.spec.mjs index 424205955fe..d653fad1f5b 100644 --- a/packages/lexical-playground/__tests__/e2e/Tables.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/Tables.spec.mjs @@ -1245,6 +1245,30 @@ test.describe.parallel('Tables', () => { ); }); + test('Can delete all with node selection', async ({ + page, + isCollab, + isPlainText, + }) => { + await initialize({isCollab, page}); + test.skip(isPlainText); + await focusEditor(page); + await page.keyboard.type('Text before'); + await page.keyboard.press('Enter'); + await insertSampleImage(page); + await page.keyboard.press('Enter'); + await page.keyboard.type('Text after'); + await insertTable(page, 2, 3); + await selectAll(page); + await page.keyboard.press('Backspace'); + await assertHTML( + page, + html` +


+ `, + ); + }); + test(`Horizontal rule inside cell`, async ({page, isPlainText, isCollab}) => { await initialize({isCollab, page}); test.skip(isPlainText); diff --git a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts index eb75797d994..604a6bf787d 100644 --- a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts +++ b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts @@ -329,16 +329,10 @@ export function applyTableHandlers( if (!parentNode) { return false; } - const nextNode = table.getNextSibling() || table.getPreviousSibling(); table.remove(); - if (nextNode) { - nextNode.selectStart(); - } else { - parentNode.selectStart(); - } } } - return true; + return false; } if ($isTableSelection(selection)) {