diff options
author | bobzel <zzzman@gmail.com> | 2023-11-07 13:48:26 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-11-07 13:48:26 -0500 |
commit | a6cc25e5d03ffed16bfaa32e48e9cc2eaff7deaf (patch) | |
tree | 1322ef9a743457f23851ba7c9d5d3dd090f1f75d /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | |
parent | a4e3b645317c4589cf49f8007f6e6b57cf2c12d3 (diff) |
Changed how selection works to avoid invalidations. Fixed Cast problem with ProxyFields that caused renameEmbedding to infinite loop.. Changed brushing for the same reason. Cleaned up a few things with filter code.
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
-rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index f73c037f4..ce63a2cf2 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -86,7 +86,17 @@ export class CollectionSchemaView extends CollectionSubView() { } @computed get _selectedDocs() { - return SelectionManager.Docs().filter(doc => Doc.AreProtosEqual(DocCast(doc.embedContainer), this.rootDoc)); + const selected = SelectionManager.Docs().filter(doc => Doc.AreProtosEqual(DocCast(doc.embedContainer), this.rootDoc)); + if (!selected.length) { + for (const sel of SelectionManager.Docs()) { + const contextPath = DocumentManager.GetContextPath(sel, true); + if (contextPath.includes(this.rootDoc)) { + const parentInd = contextPath.indexOf(this.rootDoc); + return parentInd < contextPath.length - 1 ? [contextPath[parentInd + 1]] : []; + } + } + } + return selected; } @computed get documentKeys() { |