Skip to content

Commit

Permalink
Work around bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt committed Oct 21, 2021
1 parent b19b6a5 commit 4d6aa7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ function openFolderExplorer (window, options, callback) {
element.removeAttribute(NW_DIRECTORY_DESCRIPTION);
}

// Clear out the previous value before opening the dialogu to work around
// a bug where a transformed version of the previous value is shown in the
// dialog like 'C__Users_Bob_Desktop'. See: github.com/nwjs/nw.js/issues/7786
if (element && element.files && element.files.clear) {
element.files.clear();
}

// Trigger a click event to cause the dialog to open
element.click();
}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nw-programmatic-folder-select",
"version": "1.0.4",
"version": "1.0.5",
"description": "Programmatically open a native folder select dialog in NW.js",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 4d6aa7e

Please sign in to comment.