X Tutup
Skip to content

Commit db2f0a6

Browse files
committed
Update dialog.md with info about filter extensions
There was some confusion about the correct way to add an `All Files` filter (see electron#2525), so I added it to the example. Also added a short note about the extension syntax. This is related to PR electron#2547.
1 parent d7cf460 commit db2f0a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/api/dialog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ selected, an example is:
3636
filters: [
3737
{ name: 'Images', extensions: ['jpg', 'png', 'gif'] },
3838
{ name: 'Movies', extensions: ['mkv', 'avi', 'mp4'] },
39-
{ name: 'Custom File Type', extensions: ['as'] }
39+
{ name: 'Custom File Type', extensions: ['as'] },
40+
{ name: 'All Files', extensions: ['*'] }
4041
]
4142
}
4243
```
44+
The `extensions` array should contain extensions without wildcards or dots (e.g. `'png'` is good, `'.png'` and `'*.png'` are bad). To show all files, use the `'*'` wildcard (no other wildcard is supported).
4345

4446
If a `callback` is passed, the API call would be asynchronous and the result
4547
would be passed via `callback(filenames)`

0 commit comments

Comments
 (0)
X Tutup