未验证 提交 fee735ed 编写于 作者: S SteVen Batten 提交者: GitHub

schedule update overflow action due to reflow (#64634)

* schedule update overflow action due to reflow
fixes #64514

* removed disposal
上级 fa66e421
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册