File dialogs cancel/abort events?
As all we know, there is no API for selecting files/folders, there is <input type="file">' and waiting forchange` event of it.
But there is big problem: this way we have no callback with common parameters error and filepath.
In my app user MUST choose file. But user can click × on dialog. Or simply click cancel. But app can't get event that dialog was closed without selecting filepath.
I think we finally have to get API for selecting files/folders.
So points to implement this:
- there is a lot of options currently and I have another to include — a way to rename dialog buttons and dialog title
- it's better to have single service you ask for filepath rather then lot of DOM nodes waiting for
change - as service it'll be usable from node.js context
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Thanks for reporting. Would like to support this.
@rogerwang found same API in electron — https://github.com/atom/electron/blob/master/docs/api/dialog.md
+1
+1
See (https://github.com/nwjs/nw.js/issues/4501#issuecomment-208723806) for a possible workaround to catch the cancel event, at least in nw.js 0.12.3 (not tested with 0.13)
See #4501
This is fixed in git and will be available in the next nightly build. Additional "oncancel" event listener is now supported for this.