Skip to content

开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.

fix(font-color): fix color can not be assigned when current color is empty (#55)

pubuzhixing885fdb15ff385
diff --git a/packages/drawnix/src/components/toolbar/popup-toolbar/font-color-button.tsx b/packages/drawnix/src/components/toolbar/popup-toolbar/font-color-button.tsx
index ca27349..4def299 100644
--- a/packages/drawnix/src/components/toolbar/popup-toolbar/font-color-button.tsx
+++ b/packages/drawnix/src/components/toolbar/popup-toolbar/font-color-button.tsx
@@ -58,9 +58,11 @@ export const PopupFontColorButton: React.FC<PopupFontColorButtonProps> = ({
>
<ColorPicker
onColorChange={(selectedColor: string) => {
- if (currentColor) {
- setTextColor(board, currentColor, selectedColor);
- }
+ setTextColor(
+ board,
+ currentColor ? currentColor : selectedColor,
+ selectedColor
+ );
}}
onOpacityChange={(opacity: number) => {
if (currentColor) {