Window doesn't close with `close` event handler and window.close()
See original GitHub issueNWJS Version : 0.58.0 Operating System : Windows 10
Expected behavior
When a window uses window.close()
, handling of the close
event should behave the same as if nw.Window.get().close()
was called or the user manually closed the window.
Actual behavior
If window.close()
is used to close a window, an event handler cannot be attached to the close
event. If an event is attached, the window does not actually close when win.close(true)
is called.
How to reproduce
- Open NW.js SDK and open the DevTools console.
- Execute:
nw.Window.get().on('close', function() {
this.close(true);
});
- Execute:
window.close();
- Note that the window does not close. However, the user can no longer interact with the window.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
window.close and self.close do not close the window in ...
The issue is that when I invoke window. close() or self. close() it doesn't close the window. Now there seems to be a...
Read more >Window.close() - Web APIs - MDN Web Docs - Mozilla
The Window.close() method closes the current window, or the window on which it was called. This method can only be called on windows...
Read more >Window.Closing Event (System.Windows)
The Closing event is raised when Close is called, if a window's Close button is clicked, or if the user presses ALT+F4. If...
Read more >Closing a Window with JavaScript
Now click the “Close me” in the child. It closes. Viola! That window closed itself. Observations below. Conclusion: Since we opened the child...
Read more >wx.CloseEvent — wxPython Phoenix 4.2.0 documentation
This event class contains information about window and session close events. The handler function for EVT_CLOSE is called when the user has tried...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nw7808.zip
@rogerwang Updated table with tested versions and relevant diffs
Thanks for the sample and testing. but the bug is in 0.50.0 as well