Unable to set default filter to 'All Files (*.*
)' in Windows save file dialog
#19492
Open
3 tasks done
Labels
Preflight Checklist
Problem Description
It is not possible to set the default filter on a save file dialog in Windows to
All Files (*.*)
. This is a nuisance because often when you want to save a file with no/unknown extension, such as.babelrc
, it appends the first filter's extension. Example: microsoft/vscode#28425Now, I know this is intentionally not allowed, as can be seen in
shell/browser/ui/file_dialog_win#L206
:It basically picks the first filter as the default, except for the All Files one because of a supposed issue where it appends
*.*
to the file name. However, there has to be a way to do this, because other programs do (unfortunately I couldn't think of any open source one so we could look at the sources).Proposed Solution
No real ready solution in mind. Just gotta figure out how to allow it and avoid the issue. Maybe if instead of setting the default extension to
"*.*"
we set it""
when the All Files filter is used, we could get both things to work.Alternatives Considered
Verify whether the appending
*.*
to filename issue actually happens. If it doesn't, we can just cut the code out.Additional Information
Fiddle: https://gist.github.com/e9cf0de5417180669245e79b10c2f898
The text was updated successfully, but these errors were encountered: