diff options
author | SteVen Batten <6561887+sbatten@users.noreply.github.com> | 2019-03-13 02:32:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-13 02:32:44 +0300 |
commit | e64cb27b1a0cbbc3f643c9fc6c7d93d6c6509951 (patch) | |
tree | 0358113927acd5ff610c2067983b22d5d48ee69e | |
parent | 937ba0713de88049a6255b52888b005f2f46f7de (diff) |
fixes #70022 (#70345)1.32.2
-rw-r--r-- | src/vs/base/browser/ui/menu/menubar.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vs/base/browser/ui/menu/menubar.ts b/src/vs/base/browser/ui/menu/menubar.ts index ca3ba9f3021..fd37f2e2874 100644 --- a/src/vs/base/browser/ui/menu/menubar.ts +++ b/src/vs/base/browser/ui/menu/menubar.ts @@ -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(); } |