diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/TabDocView.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index 83edc60df..f6220a6b8 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -52,8 +52,14 @@ export class TabDocView extends React.Component<TabDocViewProps> { @observable _isActive: boolean = false; @observable _isAnyChildContentActive = false; @computed get _isContentActive() { - return SelectionManager.Views().some(view => view.rootDoc === this._document) || this._isAnyChildContentActive; + const tabs = Array.from(CollectionDockingView.Instance?.tabMap ?? new Set()); + return ( + SelectionManager.Views().some(view => view.rootDoc === this._document) || + this._isAnyChildContentActive || + (tabs.findIndex(tab => tab.DashDoc === this._document) === 0 && !tabs.some(tab => SelectionManager.Views().some(dv => dv.rootDoc === tab.DashDoc))) + ); } + @observable _document: Doc | undefined; @observable _view: DocumentView | undefined; @@ -414,11 +420,7 @@ export class TabDocView extends React.Component<TabDocViewProps> { tabView = () => this._view; disableMinimap = () => !this._document || this._document.layout !== CollectionView.LayoutString(Doc.LayoutFieldKey(this._document)) || this._document?._type_collection !== CollectionViewType.Freeform; whenChildContentActiveChanges = (isActive: boolean) => (this._isAnyChildContentActive = isActive); - tabs = () => Array.from(CollectionDockingView.Instance?.tabMap ?? new Set()); - isContentActive = () => - SelectionManager.Views().some(dv => dv.rootDoc === this._document) || - this._isAnyChildContentActive || - (this.tabs().findIndex(tab => tab.DashDoc === this._document) === 0 && !this.tabs().some(tab => SelectionManager.Views().some(dv => dv.rootDoc === tab.DashDoc))); + isContentActive = () => this._isContentActive; @computed get docView() { return !this._activated || !this._document ? null : ( <> |