Skip to content

Clarify/correct OpenDialogOptions note #113831

Closed

Description

@0dinD

There is currently a note for OpenDialogOptions, which states:

  • Note 1: A dialog can select files, folders, or both. This is not true for Windows which enforces to open either files or folder, but not both.

But as I've discovered, this limitation also applies to Linux - not just Windows. Additionally, it's not clear what actually happens when specifying both canSelectFiles: true and canSelectFolders: true. Since VS Code uses the Electron API under the hood, I checked their docs about dialog, and found a much clearer note:

Note: On Windows and Linux an open dialog can not be both a file selector and a directory selector, so if you set properties to ['openFile', 'openDirectory'] on these platforms, a directory selector will be shown.

This allowed me to understand the cause of the issue I fixed in microsoft/vscode-java-dependency#434. I think it would be much clearer if the note said something like:

  • Note 1: On Windows and Linux a dialog cannot be both a file selector and a folder selector, so if you set both canSelectFiles and canSelectFolders to true on these platforms, a folder selector will be shown.

Activity

  1. gregvanl commented on Jan 5, 2021

    @gregvanl

    Hi Odin Dahlström (@0dinD), thank you for suggested clarification. The vscode-api topic is autogenerated from https://github.com/microsoft/vscode/blob/master/src/vs/vscode.d.ts so moving this suggestion to the vscode repo.
    Feel free to submit a PR with your updated note.

  2. added
    bug
    simple-file-dialog
    on Jan 6, 2021
  3. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Jan 8, 2021
  4. locked and limited conversation to collaborators on Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buginsiders-releasedsimple-file-dialogverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions