New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect extension when filters is used #9610

Merged
merged 3 commits into from Jun 15, 2017

Conversation

Projects
None yet
2 participants
@shubham2892
Contributor

shubham2892 commented May 28, 2017

Running [dialog setAllowedFileTypes:file_types]; replaces the extension in nameFieldStringValue with first value in file_types variable however if [dialog setNameFieldStringValue:default_filename]; is run after setting the allowedFileTypes the extension initially passed with the default filename is retained. Explicitly setting setExtensionHidden makes sure that extension is shown everytime.
Screenshots to confirm that issue is fixed:

Code:

   const {dialog} = require('electron')
   dialog.showSaveDialog(mainWindow, {
     defaultPath:'/tmp/test.jpg',
     filters: [
       { name: 'Image', extensions: ['jpg', 'jpeg', 'png', 'gif'] }
     ]
   }, function(filename) {})

Result:
image

#9455

@shubham2892 shubham2892 changed the title from :apple: Fix incorrect extension when filters is used to Fix incorrect extension when filters is used May 28, 2017

@shubham2892

This comment has been minimized.

Contributor

shubham2892 commented May 29, 2017

Not sure why this single test is failing on CI build, completely unrelated to changes I made. It's the same test that was failing in #9343 .

@shubham2892

This comment has been minimized.

Contributor

shubham2892 commented May 29, 2017

@kevinsawicki: Please have a look at your convenience. Thank you. 😄

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Jun 15, 2017

Thanks for fixing this @shubham2892 👍 :shipit:

@kevinsawicki kevinsawicki merged commit e8911fe into electron:master Jun 15, 2017

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment