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

Fix #64557

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