Skip to content

Commit

Permalink
fixes #70022
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten committed Mar 12, 2019
1 parent 5570695 commit 32dc72e
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 32dc72e

Please sign in to comment.