From 174c86efd17f40b3bca402b253eb8026848dfe0b Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 19 Sep 2023 15:39:56 -0400
Subject: fixed  pinning ink strokes to honor save layout/content.

---
 src/client/views/InkingStroke.tsx | 5 ++---
 1 file changed, 2 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 f5ffff639..3b9edbc56 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -82,9 +82,8 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps>() {
     screenToLocal = () => this.props.ScreenToLocalTransform().scale(this.props.NativeDimScaling?.() || 1);
 
     getAnchor = (addAsAnnotation: boolean, pinProps?: PinProps) => {
-        if (this._subContentView) {
-            return this._subContentView.getAnchor?.(addAsAnnotation) || this.rootDoc;
-        }
+        const subAnchor = this._subContentView?.getAnchor?.(addAsAnnotation);
+        if (subAnchor !== this.rootDoc) return subAnchor;
 
         if (!addAsAnnotation && !pinProps) return this.rootDoc;
 
-- 
cgit v1.2.3-70-g09d2


From b98fad407e2214512d526dcff3812879ad9b4035 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 19 Sep 2023 18:20:29 -0400
Subject: fixed closing a text box while typing in it.

---
 src/client/views/DocumentDecorations.tsx | 1 +
 src/client/views/InkingStroke.tsx        | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

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

diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index a30252b0c..40eb1fe2b 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -262,6 +262,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
             }
         });
         if (!this._iconifyBatch) {
+            (document.activeElement as any).blur?.();
             this._iconifyBatch = UndoManager.StartBatch(forceDeleteOrIconify ? 'delete selected docs' : 'iconifying');
         } else {
             forceDeleteOrIconify = false; // can't force immediate close in the middle of iconifying -- have to wait until iconifying completes
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index 3b9edbc56..f63a27426 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -83,7 +83,7 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps>() {
 
     getAnchor = (addAsAnnotation: boolean, pinProps?: PinProps) => {
         const subAnchor = this._subContentView?.getAnchor?.(addAsAnnotation);
-        if (subAnchor !== this.rootDoc) return subAnchor;
+        if (subAnchor !== this.rootDoc && subAnchor) return subAnchor;
 
         if (!addAsAnnotation && !pinProps) return this.rootDoc;
 
-- 
cgit v1.2.3-70-g09d2

