mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: <webview> focus / blur events don't work with contextIsolation enabled (#29025)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
@@ -162,7 +162,7 @@ export class WebViewImpl {
|
||||
|
||||
// Emits focus/blur events.
|
||||
onFocusChange () {
|
||||
const hasFocus = document.activeElement === this.webviewNode;
|
||||
const hasFocus = this.webviewNode.ownerDocument.activeElement === this.webviewNode;
|
||||
if (hasFocus !== this.hasFocus) {
|
||||
this.hasFocus = hasFocus;
|
||||
this.dispatchEvent(hasFocus ? 'focus' : 'blur');
|
||||
|
||||
Reference in New Issue
Block a user