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

feat: add mode for selecting directories in file dialog #8057

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sissbruecker
Copy link
Contributor

Description

Adds a directory property which allows users to select a directory to upload from the upload file dialog. This recursively adds all files from the selected directory to the file list. Files are still filtered by the accept filter, and non-matching files will be rejected.

Some notes regarding the implementation:

  • This only allows to select a single directory, it is not possible to select files or multiple directories. That is a browser limitation.
  • All browsers that I've tested with show a confirmation dialog after selecting the directory where the user must confirm that they really want to upload all contents of that directory.
  • It's still possible to drag and drop a combination of files and directories. I couldn't see a reason to disallow that, assuming that selecting a directory would just be a different shortcut to adding multiple files. Related to that, I didn't see the need to change the drop files label in this case.

Part of #857

# Conflicts:
#	packages/upload/src/vaadin-upload-mixin.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants