Skip to content

unclear allowDirectories behavior #1893

@grnd-alt

Description

@grnd-alt

The filePickerBuilder.allowDirectories() function sets the allowPickDirectory prop in FilePicker.vue
that prop, however is used in two places:

  1. as allowPickDirectory prop for FileList https://github.com/nextcloud-libraries/nextcloud-dialogs/blob/main/lib/components/FilePicker/FilePicker.vue#L40
  2. as showMenu prop for FilePickerBreadcrumbs https://github.com/nextcloud-libraries/nextcloud-dialogs/blob/main/lib/components/FilePicker/FilePicker.vue#L28

so in order to hide the +New button in the filePicker (e.g. when selecting a folder to search in in the unified search) one would set allowPickDirectory to false but that does have side effects on the FileList behavior

I came across this in this PR: nextcloud/server#54234 as I need to hide the + New button but still make directories selectable (which somehow still works in the PR as the "Pick" button is inserted by the files app and not by dialogs I guess).

Should we maybe have a second prop for showMenu?

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions