From 6f5ecfead9f46cf7ee008971c813fc3316d75229 Mon Sep 17 00:00:00 2001 From: Colin Grant Date: Tue, 14 Mar 2023 14:46:49 -0600 Subject: [PATCH] Show tabbar when items present --- .../src/browser/shell/tab-bar-toolbar/tab-bar-toolbar.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/core/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar.tsx b/packages/core/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar.tsx index 95eef53474688..059ae8d3ca7f1 100644 --- a/packages/core/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar.tsx +++ b/packages/core/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar.tsx @@ -56,11 +56,8 @@ export class TabBarToolbar extends ReactWidget { super(); this.addClass(TabBarToolbar.Styles.TAB_BAR_TOOLBAR); this.hide(); - this.onRender = this.onRender.bind(this); } - protected onRender = () => this.show(); - updateItems(items: Array, current: Widget | undefined): void { this.inline.clear(); this.more.clear(); @@ -81,7 +78,9 @@ export class TabBarToolbar extends ReactWidget { this.updateContextKeyListener(contextKeys); this.setCurrent(current); - if (!items.length) { + if (items.length) { + this.show(); + } else { this.hide(); } this.update(); @@ -152,7 +151,6 @@ export class TabBarToolbar extends ReactWidget { const toolbarItemClassNames = this.getToolbarItemClassNames(item); if (item.menuPath && !item.command) { toolbarItemClassNames.push('enabled'); } return