From 09e5f2c58ca87ded318627cbc5dea436989fcff2 Mon Sep 17 00:00:00 2001
From: vkalev <vjk1883@gmail.com>
Date: Thu, 29 Jul 2021 09:51:50 -0400
Subject: deselecting an ink stroke properly exits edit view

---
 src/client/views/InkingStroke.tsx | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'src/client/views/InkingStroke.tsx')

diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index a8f32118c..21059b330 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -65,11 +65,19 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
         }
     }
 
+    /**
+     * Ensures the ink controls and handles aren't rendered when the current ink stroke is reselected.
+     */
+    @action
+    toggleControlButton = () => {
+        if (!this.props.isSelected() && this._properties) {
+            this._properties._controlButton = false;
+        }
+    }
+
     render() {
         TraceMobx();
-        // if (!this.props.isSelected() && this._properties) {
-        //     this._properties._controlButton = false;
-        // }
+        this.toggleControlButton();
         // Extracting the ink data and formatting information of the current ink stroke.
         const data: InkData = Cast(this.dataDoc[this.fieldKey], InkField)?.inkData ?? [];
         const inkDoc: Doc = this.layoutDoc;
-- 
cgit v1.2.3-70-g09d2

