Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #70022 #70345

Merged
merged 1 commit into from
Mar 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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