提交 a988c5e8 编写于 作者: S Sandeep Somavarapu

Fix #64557

上级 9be22498
...@@ -404,6 +404,7 @@ export class CustomTreeView extends Disposable implements ITreeView { ...@@ -404,6 +404,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
} else { } else {
this.hideMessage(); this.hideMessage();
} }
this.updateContentAreas();
} }
private showMessage(message: string | IMarkdownString): void { private showMessage(message: string | IMarkdownString): void {
...@@ -513,7 +514,6 @@ export class CustomTreeView extends Disposable implements ITreeView { ...@@ -513,7 +514,6 @@ export class CustomTreeView extends Disposable implements ITreeView {
private doRefresh(elements: ITreeItem[]): Promise<void> { private doRefresh(elements: ITreeItem[]): Promise<void> {
if (this.tree) { if (this.tree) {
DOM.removeClass(this.treeContainer, 'hasChildren');
return Promise.all(elements.map(e => this.tree.refresh(e))) return Promise.all(elements.map(e => this.tree.refresh(e)))
.then(() => { .then(() => {
this.updateContentAreas(); this.updateContentAreas();
...@@ -526,12 +526,14 @@ export class CustomTreeView extends Disposable implements ITreeView { ...@@ -526,12 +526,14 @@ export class CustomTreeView extends Disposable implements ITreeView {
} }
private updateContentAreas(): void { private updateContentAreas(): void {
if (this.root.children && this.root.children.length) { const isTreeEmpty = !this.root.children || this.root.children.length === 0;
DOM.addClass(this.treeContainer, 'hasChildren'); // Hide tree container only when there is a message and tree is empty
this.domNode.removeAttribute('tabindex'); if (this._messageValue && isTreeEmpty) {
} else { DOM.addClass(this.treeContainer, 'hide');
DOM.removeClass(this.treeContainer, 'hasChildren');
this.domNode.setAttribute('tabindex', '0'); this.domNode.setAttribute('tabindex', '0');
} else {
DOM.removeClass(this.treeContainer, 'hide');
this.domNode.removeAttribute('tabindex');
} }
} }
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
height: 100%; height: 100%;
} }
.monaco-workbench .tree-explorer-viewlet-tree-view .customview-tree:not(.hasChildren) { .monaco-workbench .tree-explorer-viewlet-tree-view .customview-tree.hide {
display: none; display: none;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册