-
Notifications
You must be signed in to change notification settings - Fork 83
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: allow dropping folders #8032
Conversation
} | ||
|
||
const filePromises = Array.from(dropEvent.dataTransfer.items) | ||
.map((item) => item.webkitGetAsEntry()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment webkitGetAsEntry seems to be the only API that allows retrieving a folder from a data transfer item that is supported by all browsers.
There is also getAsFileSystemHandle, but that isn't supported by FF or Safari. Then there are some mentions of other APIs in the referenced issue, none of which seem to have made it into the standard.
Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
Quality Gate passedIssues Measures |
This ticket/PR has been released with Vaadin 24.6.0.beta1 and is also targeting the upcoming stable 24.6.0 version. |
Allows to drop folders into the upload component. Folders will be scanned recursively for files and any file found will be added to the file list for uploading. It's also possible to drop a combination of files and folders. Files are still filtered by the accept filter and any non-matching file will be discarded.
Just noting that this doesn't introduce any new concepts such as having folders as a separate entry in the upload component. This is just a shortcut for adding all files from a folder to the upload.
Part of #857