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
feat: Added ability to configure if window should close when opener closes #31314
Conversation
I believe this one would also be for @nornagon. Since he is on leave I am tagging @codebytere |
c6d42c1
to
0f58582
Compare
The documentation isn't clear - I've made a suggestion but feel free to improve it with something else.
Am I missing something? |
People who are familiar with this API are happen to be either not available or busy with other things, and this month I believe this organization still won't get much activity, so sorry this might have to wait for review until next month. |
Thank you for the info. |
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
fbab8db
to
d73176f
Compare
This seems like a reasonable addition; it's a little regrettable that we have this default behavior left over from the early days.
I'd like to bikeshed a little on the name of the option as closeWithOpener
is kind of a mindbender, and also it's generally preferable to have the default of a boolean be false
. Perhaps outlivesParent
or remainsWhenParentCloses
? parent
is sort of an imprecise term here but I'd rather avoid a name with both the words "open" and "close" in it. Or maybe closeWhenParentCloses
(though this is the opposite sense & the default would be true
)?
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
API LGTM |
Release Notes Persisted
|
…ses (electron#31314) * feat: Added ability to configure if window should close when opener closes * fix: check if embedder is destroyed * fix: correctly take over closeWithOpener property * chore: Added documentation * Update docs/api/window-open.md Co-authored-by: John Kleinschmidt <jkleinsc@github.com> * chore: refactor Co-authored-by: Jeremy Rose <nornagon@nornagon.net> * chore: changed property name from `closeWithOpener` to `outlivesOpener` * dummy change to kick lint * undo above Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Description of Change
Fixes: #11128
Currently electron automatically closes child windows when the opener window closes.
This behavior is a left over from the Atom text editor and does not conform with standard browser behavior.
The PR adds the ability to control this behavior, since it is not possible to deactivate this without hacks.
Note: This is not a breaking change since the flag is not required and the default stays the same as it used to be.
Checklist
npm test
passesRelease Notes
Notes: Added ability to configure if window should close when opener closes