From 600bef3da031880fd72361ac55769cd00c9d0242 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Mon, 23 Jun 2025 11:28:06 -0700 Subject: [PATCH] fix(editor): prevent text color removal from other list items when setting color in lists 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" }}