From 0f3d6bdbf56f3b971094afde6205dfa6d6235f1d Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 15 Sep 2020 00:10:49 -0400
Subject: made focusing on a tree view item focus on the tree view.

---
 src/client/views/collections/CollectionTreeView.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/client/views/collections/CollectionTreeView.tsx')

diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx
index 463439762..b27f75837 100644
--- a/src/client/views/collections/CollectionTreeView.tsx
+++ b/src/client/views/collections/CollectionTreeView.tsx
@@ -550,6 +550,8 @@ class TreeView extends React.Component<TreeViewProps> {
         </>;
     }
 
+    refocus = () => this.props.treeView.props.focus(this.props.treeView.props.Document);
+
     render() {
         TraceMobx();
         if (this.props.renderedIds.indexOf(this.doc[Id]) !== -1) return null;
@@ -595,7 +597,7 @@ class TreeView extends React.Component<TreeViewProps> {
                                 fitToBox={this.boundsOfCollectionDocument !== undefined}
                                 PanelWidth={this.rtfWidth}
                                 PanelHeight={this.rtfOutlineHeight}
-                                focus={returnFalse}
+                                focus={this.refocus}
                                 ScreenToLocalTransform={this.docTransform}
                                 docFilters={returnEmptyFilter}
                                 searchFilterDocs={returnEmptyDoclist}
@@ -930,7 +932,7 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
                 backgroundColor={this.props.backgroundColor}
                 PanelWidth={this.rtfWidth}
                 PanelHeight={this.rtfOutlineHeight}
-                focus={returnFalse}
+                focus={this.props.focus}
                 ScreenToLocalTransform={this.titleTransform}
                 docFilters={returnEmptyFilter}
                 searchFilterDocs={returnEmptyDoclist}
-- 
cgit v1.2.3-70-g09d2

