From cf7beac8b1de637fb4c0de86234ab617798d9379 Mon Sep 17 00:00:00 2001
From: geireann <geireann.lindfield@gmail.com>
Date: Thu, 26 Aug 2021 11:06:17 -0400
Subject: added toggleBold

---
 src/client/views/nodes/formattedText/RichTextMenu.tsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'src/client/views/nodes/formattedText/RichTextMenu.tsx')

diff --git a/src/client/views/nodes/formattedText/RichTextMenu.tsx b/src/client/views/nodes/formattedText/RichTextMenu.tsx
index e32eccb62..4f40b59f2 100644
--- a/src/client/views/nodes/formattedText/RichTextMenu.tsx
+++ b/src/client/views/nodes/formattedText/RichTextMenu.tsx
@@ -279,6 +279,17 @@ export class RichTextMenu extends AntimodeMenu<AntimodeMenuProps>   {
         });
     }
 
+    toggleBold = (view: EditorView, forceBool?:boolean) => {
+        if (forceBool) { 
+            const mark = view.state.schema.marks.bold.create({bold: true});
+            this.setMark(mark, view.state, view.dispatch, true);
+        }
+        else {
+            console.log(toggleMark);
+            toggleMark(view.state.schema.marks.bold);
+        }
+    }
+
 
     setFontSize = (size:number, view: EditorView) => {
         const fmark = view.state.schema.marks.pFontSize.create({ fontSize: size });
@@ -378,6 +389,7 @@ export class RichTextMenu extends AntimodeMenu<AntimodeMenuProps>   {
             view.focus();
             return true;
         });
+        view.focus();
         dispatch?.(tr);
         return true;
     }
-- 
cgit v1.2.3-70-g09d2

