Nw.js: NWJS SDK 0.23.6 confirm to exit not responding mouse clicks

Created on 20 Jul 2017  路  5Comments  路  Source: nwjs/nw.js

I'm trying to create a confirm message to close the main window using the confirm() function.

The problem is that when the confirmation appears it freezes to mouse events. I need to press ENTER or SPACE to confirm and ESC to cancel.

Example:

package.json

{
    "name": "test",
    "version": "0.0.1",
    "main": "index.html" 
}

index.html

<html>
<head>
<script>
  var gui = require('nw.gui');
  gui.Window.get().on('close', function() {
  var r = confirm("Do you really want to leave?");
    if (r == true) {
       this.close(true);
    } 
  });
</script>
</head>
<body>
   Close and confirm with mouse click on OK!
</body>
</html>
P2 bug triaged

All 5 comments

On Windows with nwjs-sdk-v0.23.6, when close the window, I can't see the confirmation message, and the mouse click doesn't work, need press Enter or ESC.

This issue doesn't happen on Linux.

It doesn't accept clicks with an alert() either in nwjs-sdk-v0.23.6. I noticed this when I sprinkled some test "alert()" messages in my app the other day, and I couldn't close them with the mouse. Just tried again now by calling an alert from the devtools console, and it won't accept clicks, so it should be easy to reproduce.

I've tested with latest http://dl.nwjs.io/v0.23.7/
it works

Thanks. Close as it's fixed in 0.23.7.

Was this page helpful?
0 / 5 - 0 ratings