aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionTreeView.tsx
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-04-06 13:22:35 -0400
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-04-06 13:22:35 -0400
commite35257cbcf6fa54ba639693d6cf966238b5393ea (patch)
tree3eaed8456d1e4996296bcb8f4c4a7cb1faba0aba /src/client/views/collections/CollectionTreeView.tsx
parent9cc6eb1f2b5438f4046933124484c4e79d38dc5a (diff)
parentd01fdacae8e96c99a095dd2c97f62144ab81def5 (diff)
Merge branch 'filters' of https://github.com/browngraphicslab/Dash-Web into filters
Diffstat (limited to 'src/client/views/collections/CollectionTreeView.tsx')
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx
index 44dd9ddd8..a8a2aaa5a 100644
--- a/src/client/views/collections/CollectionTreeView.tsx
+++ b/src/client/views/collections/CollectionTreeView.tsx
@@ -67,7 +67,7 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
Object.values(this._disposers).forEach(disposer => disposer?.());
}
- componentWillMount() {
+ componentDidMount() {
this._disposers.autoheight = reaction(() => this.rootDoc.autoHeight,
auto => auto && this.computeHeight(),
{ fireImmediately: true });
@@ -112,7 +112,7 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
const targetDataDoc = this.doc[DataSym];
const value = DocListCast(targetDataDoc[this.props.fieldKey]);
const result = value.filter(v => !docs.includes(v));
- SelectionManager.DeselectAll();
+ if ((doc instanceof Doc ? [doc] : doc).some(doc => SelectionManager.Views().some(dv => Doc.AreProtosEqual(dv.rootDoc, doc)))) SelectionManager.DeselectAll();
if (result.length !== value.length) {
const ind = targetDataDoc[this.props.fieldKey].indexOf(doc);
const prev = ind && targetDataDoc[this.props.fieldKey][ind - 1];