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.
This commit is contained in:
Philipinho
2025-06-23 11:28:06 -07:00
parent 65b01038d7
commit 600bef3da0

View File

@ -156,13 +156,11 @@ export const ColorSelector: FC<ColorSelectorProps> = ({
) )
} }
onClick={() => { onClick={() => {
if (name === "Default") {
editor.commands.unsetColor(); editor.commands.unsetColor();
name !== "Default" && } else {
editor editor.chain().focus().setColor(color || "").run();
.chain() }
.focus()
.setColor(color || "")
.run();
setIsOpen(false); setIsOpen(false);
}} }}
style={{ border: "none" }} style={{ border: "none" }}