Skip to content

Commit

Permalink
aux window - ensure webview's window gets focus (#208169)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored Mar 20, 2024
1 parent 2dd85de commit 5f298a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vs/workbench/contrib/webview/browser/webviewElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,11 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD
return;
}

// It is possible for the webview to be contained in another window
// that does not have focus. As such, also focus the body of the
// webview's window to ensure it is properly receiving keyboard focus.
this.window?.document.body?.focus();

this._send('focus', undefined);
});
}
Expand Down

0 comments on commit 5f298a7

Please sign in to comment.