mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
schedule update overflow action due to reflow (#64634)
* schedule update overflow action due to reflow fixes #64514 * removed disposal
This commit is contained in:
@@ -80,6 +80,7 @@ export class MenuBar extends Disposable {
|
||||
|
||||
private numMenusShown: number;
|
||||
private menuStyle: IMenuStyles;
|
||||
private overflowLayoutScheduled: IDisposable;
|
||||
|
||||
constructor(private container: HTMLElement, private options: IMenuBarOptions = {}) {
|
||||
super();
|
||||
@@ -375,6 +376,8 @@ export class MenuBar extends Disposable {
|
||||
|
||||
DOM.removeNode(this.overflowMenu.titleElement);
|
||||
DOM.removeNode(this.overflowMenu.buttonElement);
|
||||
|
||||
this.overflowLayoutScheduled = dispose(this.overflowLayoutScheduled);
|
||||
}
|
||||
|
||||
blur(): void {
|
||||
@@ -490,7 +493,12 @@ export class MenuBar extends Disposable {
|
||||
this.updateLabels(menuBarMenu.titleElement, menuBarMenu.buttonElement, menuBarMenu.label);
|
||||
});
|
||||
|
||||
this.updateOverflowAction();
|
||||
if (!this.overflowLayoutScheduled) {
|
||||
this.overflowLayoutScheduled = DOM.scheduleAtNextAnimationFrame(() => {
|
||||
this.updateOverflowAction();
|
||||
this.overflowLayoutScheduled = void 0;
|
||||
});
|
||||
}
|
||||
|
||||
this.setUnfocusedState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user