Skip to content

Commit

Permalink
fixes #70022 (#70345)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten authored Mar 12, 2019
1 parent 937ba07 commit e64cb27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vs/base/browser/ui/menu/menubar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ export class MenuBar extends Disposable {
this._register(DOM.addDisposableListener(this.container, DOM.EventType.FOCUS_OUT, (e) => {
let event = e as FocusEvent;

if (!event.relatedTarget || !this.container.contains(event.relatedTarget as HTMLElement)) {
// We are losing focus and there is no related target, e.g. webview case
if (!event.relatedTarget) {
this.setUnfocusedState();
}
// We are losing focus and there is a target, reset focusToReturn value as not to redirect
else if (event.relatedTarget && !this.container.contains(event.relatedTarget as HTMLElement)) {
this.focusToReturn = undefined;
this.setUnfocusedState();
}
Expand Down

0 comments on commit e64cb27

Please sign in to comment.