This commit is contained in:
SteVen Batten
2019-03-12 15:47:30 -07:00
parent 55706951d1
commit 32dc72e557

View File

@@ -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();
}