mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix overflow menu disappearing (#10236)
This commit is contained in:
@@ -28,6 +28,7 @@ export class OverflowActionBar extends ActionBar {
|
|||||||
private _overflow: HTMLElement;
|
private _overflow: HTMLElement;
|
||||||
private _moreItemElement: HTMLElement;
|
private _moreItemElement: HTMLElement;
|
||||||
private _moreActionsElement: HTMLElement;
|
private _moreActionsElement: HTMLElement;
|
||||||
|
private _previousWidth: number;
|
||||||
|
|
||||||
constructor(container: HTMLElement, options: IActionBarOptions = defaultOptions) {
|
constructor(container: HTMLElement, options: IActionBarOptions = defaultOptions) {
|
||||||
super(container, options);
|
super(container, options);
|
||||||
@@ -83,7 +84,7 @@ export class OverflowActionBar extends ActionBar {
|
|||||||
break;
|
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()) {
|
while (width === fullWidth && this._overflow.hasChildNodes()) {
|
||||||
// move placeholder in this._items
|
// move placeholder in this._items
|
||||||
let placeHolderItem = this._items.splice(this._actionsList.childNodes.length - 1, 1);
|
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 {
|
private collapseItem(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user