From 0906eab4135db844dc45a20d33f84e7439461c9b Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 5 Jul 2022 12:33:28 -0400
Subject: fixed sidebar annos to be editable (with i-beam cursor) when selected
 and to be active when parent document is active.  fixed previewing a sidebar
 annotation to not open up sidebar

---
 src/client/views/nodes/formattedText/FormattedTextBox.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 8e1698eba..f83fdffc9 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1607,6 +1607,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
                     dataDoc={this.dataDoc}
                     // usePanelWidth={true}
                     nativeWidth={NumCast(this.layoutDoc._nativeWidth)}
+                    whenChildContentsActiveChanged={this.whenChildContentsActiveChanged}
                     showSidebar={this.SidebarShown}
                     PanelWidth={this.sidebarWidth}
                     setHeight={this.setSidebarHeight}
@@ -1645,8 +1646,8 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
     }
     render() {
         TraceMobx();
-        const selected = this.props.isSelected() || this.Document.forceActive;
-        const active = this.props.isContentActive();
+        const active = this.props.isContentActive() || this.props.isSelected();
+        const selected = active;
         const scale = (this.props.scaling?.() || 1) * NumCast(this.layoutDoc._viewScale, 1);
         const rounded = StrCast(this.layoutDoc.borderRounding) === "100%" ? "-rounded" : "";
         const interactive = (CurrentUserUtils.ActiveTool === InkTool.None || SnappingManager.GetIsDragging()) && (this.layoutDoc.z || !this.layoutDoc._lockedPosition);
-- 
cgit v1.2.3-70-g09d2

