From 8449888db8ff928e3236996fde5f33c49e67de8a Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Fri, 1 May 2020 10:19:33 -0700 Subject: [PATCH] fix overflow menu disappearing (#10236) --- src/sql/base/browser/ui/taskbar/overflowActionbar.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sql/base/browser/ui/taskbar/overflowActionbar.ts b/src/sql/base/browser/ui/taskbar/overflowActionbar.ts index 7006108186..770fac818b 100644 --- a/src/sql/base/browser/ui/taskbar/overflowActionbar.ts +++ b/src/sql/base/browser/ui/taskbar/overflowActionbar.ts @@ -28,6 +28,7 @@ export class OverflowActionBar extends ActionBar { private _overflow: HTMLElement; private _moreItemElement: HTMLElement; private _moreActionsElement: HTMLElement; + private _previousWidth: number; constructor(container: HTMLElement, options: IActionBarOptions = defaultOptions) { super(container, options); @@ -83,7 +84,7 @@ export class OverflowActionBar extends ActionBar { break; } } - } else if (this._overflow?.hasChildNodes()) { // uncollapse actions if there is space for it + } else if (this._overflow?.hasChildNodes() && width > this._previousWidth) { // uncollapse actions if there is space for it while (width === fullWidth && this._overflow.hasChildNodes()) { // move placeholder in this._items let placeHolderItem = this._items.splice(this._actionsList.childNodes.length - 1, 1); @@ -106,6 +107,8 @@ export class OverflowActionBar extends ActionBar { } } } + + this._previousWidth = width; } private collapseItem(): void {