From 77505cad757a0b7e0babf4d7e78c1ad58b135916 Mon Sep 17 00:00:00 2001 From: Joo Hee Paige Kim <70982342+paigekim29@users.noreply.github.com> Date: Tue, 21 Nov 2023 05:29:11 +0900 Subject: [PATCH] Fix: Apply background color to multiple selected cells (#5258) --- .../src/plugins/TableActionMenuPlugin/index.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/lexical-playground/src/plugins/TableActionMenuPlugin/index.tsx b/packages/lexical-playground/src/plugins/TableActionMenuPlugin/index.tsx index 48f47d8667c..608a0b125c1 100644 --- a/packages/lexical-playground/src/plugins/TableActionMenuPlugin/index.tsx +++ b/packages/lexical-playground/src/plugins/TableActionMenuPlugin/index.tsx @@ -479,6 +479,17 @@ function TableActionMenu({ if ($isTableCellNode(cell)) { cell.setBackgroundColor(value); } + + if (DEPRECATED_$isGridSelection(selection)) { + const nodes = selection.getNodes(); + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (DEPRECATED_$isGridCellNode(node)) { + node.setBackgroundColor(value); + } + } + } } }); },