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.
This commit is contained in:
Philip Okugbe
2025-06-23 19:31:30 +01:00
committed by GitHub
parent 65b01038d7
commit e775e4dd8c

View File

@ -156,13 +156,11 @@ export const ColorSelector: FC<ColorSelectorProps> = ({
)
}
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" }}