[Bug]: SaveDialog is not treating Package as File when setting defaultPath to a file that already exists #43664
Labels
32-x-y
bug 🪲
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
platform/macOS
Preflight Checklist
Electron Version
32.0.0
What operating system(s) are you using?
macOS
Operating System Version
macOS Sonoma 14.6.1
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
When using the saveDialog, if the path is set to an existing file (package) the the file should not be selectable and the "file already Existing" warning should appear instead.
Actual Behavior
To test this - you can point the saveDialog defaultPath to any existing package file (i.e. xcodeproj)
dialog.showSaveDialog({ defaultPath: YOUR_PATH_TO_EXISTING_PACKAGE_FILE.xcodeproj, properties: [], filters: { name: 'directories', extensions: [] }, // to prevent file selection properties: ['showOverwriteConfirmation'] })
You see that the dialog then selects the package (as if it was a directory) and shows its content.
Also if the extension is removed, then it also does not detect it as a duplicate file.
Any info or guidance to how to resolve is appreciated.
Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: