diff --git a/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/TablesHTMLCopyAndPaste.spec.mjs b/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/TablesHTMLCopyAndPaste.spec.mjs index 7f462e36d5b..1b7c5cc87ec 100644 --- a/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/TablesHTMLCopyAndPaste.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/TablesHTMLCopyAndPaste.spec.mjs @@ -386,7 +386,8 @@ test.describe('HTML Tables CopyAndPaste', () => { + class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected" + style="background-color: rgb(242, 243, 245)">

@@ -394,7 +395,8 @@ test.describe('HTML Tables CopyAndPaste', () => {

+ class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected" + style="background-color: rgb(242, 243, 245)">

@@ -412,7 +414,8 @@ test.describe('HTML Tables CopyAndPaste', () => { + class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected" + style="background-color: rgb(242, 243, 245)">

diff --git a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts index 10d83e36bbf..8472dca94de 100644 --- a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts +++ b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts @@ -800,6 +800,9 @@ export function applyTableHandlers( } const originalChildren = currentGridCellNode.getChildren(); + currentGridCellNode.setBackgroundColor( + newGridCellNode.getBackgroundColor(), + ); newGridCellNode.getChildren().forEach((child) => { if ($isTextNode(child)) { const paragraphNode = $createParagraphNode();