mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
This commit is contained in:
@@ -158,7 +158,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(new Event(hasFocus ? 'focus' : 'blur'));
|
||||
|
||||
Reference in New Issue
Block a user