From 4ab742c54d600fb62b02268f48e711258558924b Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Tue, 10 Dec 2019 18:47:27 -0500
Subject: fixes to color marks

---
 src/client/util/TooltipTextMenu.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/client/util/TooltipTextMenu.tsx')

diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx
index 01d566831..f29dbf2e4 100644
--- a/src/client/util/TooltipTextMenu.tsx
+++ b/src/client/util/TooltipTextMenu.tsx
@@ -839,9 +839,11 @@ export class TooltipTextMenu {
     }
 
     public static insertColor(color: String, state: EditorState<any>, dispatch: any) {
-        if (state.selection.empty) return false;
-
         const colorMark = state.schema.mark(state.schema.marks.pFontColor, { color: color });
+        if (state.selection.empty) {
+            dispatch(state.tr.addStoredMark(colorMark));
+            return false;
+        }
         dispatch(state.tr.addMark(state.selection.from, state.selection.to, colorMark));
     }
 
-- 
cgit v1.2.3-70-g09d2

