-
Notifications
You must be signed in to change notification settings - Fork 15k
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
window.focus from webapp does not trigger the focus event of the BrowserWindow #25578
Comments
When focus is called on DOM's Window Electron is notified with call to
fixes the problem. What do you think about it? I'm worried about possible double calls to |
repros in Electron 21 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Still a problem |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Bump |
Same issue here |
@codebytere @MarshallOfSound @nornagon any update? we would like to focus child windows via basic |
@bpasero i'm trying to repro to little success - do you have a repro? I tried https://gist.github.com/7b537954b7575085143d70f767ad5644 and the focus event triggered as expected |
@codebytere thanks for following up, so far I have only seen it in VS Code where a child window ( |
@codebytere in my testing of your gist (on Windows), the focus event gets triggered when the window is first opened. But we don't get a second log when your |
@codebytere reproduces for me with the gist https://gist.github.com/cb0763b1f310a640a360dd40ef0897e6 in Fiddle using Electron 25.x: |
@bpasero figured out what i was missing - will work on this today. |
Hi @codebytere, please keep us posted for any updates on this issue when you have a chance. Thank you so much! |
Preflight Checklist
Issue Details
Expected Behavior
When I open a window in the webapp that's in my
BrowserWindow
, I expect that callingwin.focus()
focuses theBrowserWindow
Actual Behavior
w.focus()
doesn't do anything and doesn't emit thefocus
eventTo Reproduce
This is basically this issue which was closed. The part of the issue about
win.close()
not working appears to have been fixed, so I'm opening a new issue for the focus issue.If you run the jsfiddle in Chrome, the focus button will put focus in the window.
Notice the "focus" event of the window doesn't fire.
The text was updated successfully, but these errors were encountered: