From e775e4dd8c081d695d64f91b70e42174864d519f Mon Sep 17 00:00:00 2001 From: Philip Okugbe <16838612+Philipinho@users.noreply.github.com> Date: Mon, 23 Jun 2025 19:31:30 +0100 Subject: [PATCH] fix(editor): prevent text color removal from other list items when setting color in lists (#1289) Only unset color when 'Default' is selected. This ensures setting color on one list item does not remove it from others. --- .../editor/components/bubble-menu/color-selector.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/client/src/features/editor/components/bubble-menu/color-selector.tsx b/apps/client/src/features/editor/components/bubble-menu/color-selector.tsx index fd6c0e3d..1148e0f4 100644 --- a/apps/client/src/features/editor/components/bubble-menu/color-selector.tsx +++ b/apps/client/src/features/editor/components/bubble-menu/color-selector.tsx @@ -156,13 +156,11 @@ export const ColorSelector: FC = ({ ) } onClick={() => { - editor.commands.unsetColor(); - name !== "Default" && - editor - .chain() - .focus() - .setColor(color || "") - .run(); + if (name === "Default") { + editor.commands.unsetColor(); + } else { + editor.chain().focus().setColor(color || "").run(); + } setIsOpen(false); }} style={{ border: "none" }}