mirror of
https://github.com/docmost/docmost.git
synced 2025-11-10 08:52:05 +10:00
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:
@ -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" }}
|
||||||
|
|||||||
Reference in New Issue
Block a user