Skip to content
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

Electron.remote.dialog.showOpenDialog limits FilePicker dialog to directory selector on Windows and Linux #113

Closed
jettseale opened this issue Jun 19, 2020 · 1 comment · Fixed by #359
Labels
bug Bug reports or bug fixes
Milestone

Comments

@jettseale
Copy link
Collaborator

jettseale commented Jun 19, 2020

Describe the bug
FilePickerDialog uses Electron.remote.dialog.showOpenDialog for selecting multiple files and directories for opening (via the properties: ['openFile', 'openDirectory', 'multiSelections'] configuration). However, on Windows and Linux a single Electron.remote.dialog.showOpenDialog instance cannot be both a file selector and directory selector at the same time. If you set properties to ['openFile', 'openDirectory'] on these platforms, only a directory selector will be shown. This issue is noted in Electron's GitHub page here.

To Reproduce
Steps to reproduce the behavior:

  1. Open Synectic with either a Windows or Linux machine.
  2. Click on the OPEN FILE... button.
  3. Navigate to a directory that contains a file.
  4. See error.

Expected behavior
FilePickerDialog should show both files and directories, not just directories.

Screenshots
N/A.

Versions (please complete the following information):

  • OS: Windows and Linux.
  • Synectic Version: 1.0.0-beta (branch: feature/branch-switching).

Additional context
This bug was observed only on a Windows machine, but according to Electron's docs it is an issue that occurs on Linux machines as well.

@jettseale jettseale added the bug Bug reports or bug fixes label Jun 19, 2020
@nelsonni nelsonni changed the title FilePicker's Electron dialog doesn't show both files and directories on Windows and Linux Electron.remote.dialog.showOpenDialog limits FilePicker dialog to directory selector on Windows and Linux Jun 23, 2020
@nelsonni
Copy link
Member

nelsonni commented Mar 4, 2021

2ce4a7e introduces logic to display File -> Open File... and File -> Open Directory... options when the OS is Linux or Windows, and only File -> Open... on Mac. The important logic is:

const isMac = process.platform === 'darwin';

This commit should be introduced in a PR soon, and will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports or bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants