From b98fad407e2214512d526dcff3812879ad9b4035 Mon Sep 17 00:00:00 2001 From: bobzel 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') 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() { 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