-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Open
Labels
26-x-y27-x-ybug 🪲component/webcontentshas-repro-commentIssue has repro in commentsIssue has repro in commentsplatform/windowsstatus/confirmedA maintainer reproduced the bug or agreed with the featureA maintainer reproduced the bug or agreed with the feature
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
26.2.1
What operating system are you using?
Windows
Operating System Version
Windows 11 Pro 22H2 22621.2428
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Suppose I have a dialog element with an autofocus input:
<dialog>
<label>
This should be auto-focused and editable:
<input autofocus />
</label>
</dialog>
Now suppose I want to show that dialog:
document.querySelector('dialog').showModal();
The input element is auto-focused as expected and all is well.
Actual Behavior
However, now suppose I want to show that dialog after showing a standard alert()
or confirm()
:
alert('This alert will block the focusable element.');
document.querySelector('dialog').showModal();
The input element is no longer focused, is no longer editable, and seemingly completely stuck until I give focus to a different window entirely, and then come back to the Electron app.
Testcase Gist URL
https://sfo2.digitaloceanspaces.com/festive-sky/alert-focus-test.html
Additional Information
This type of thing works fine in Google Chrome. It seems to be an issue specific to Electron.
Metadata
Metadata
Assignees
Labels
26-x-y27-x-ybug 🪲component/webcontentshas-repro-commentIssue has repro in commentsIssue has repro in commentsplatform/windowsstatus/confirmedA maintainer reproduced the bug or agreed with the featureA maintainer reproduced the bug or agreed with the feature