@uppy/utils
Advanced tools
Comparing version 4.1.1 to 4.1.2
# @uppy/utils | ||
## 4.1.2 | ||
Released: 2022-08-17 | ||
Included in: Uppy v2.13.4 | ||
- @uppy/utils: fix drop of multiple files on Chromium browsers (Antoine du Hamel / #3998) | ||
## 4.1.1 | ||
@@ -4,0 +11,0 @@ |
@@ -52,3 +52,3 @@ "use strict"; | ||
async function* getFilesFromDataTransfer(dataTransfer, logDropError) { | ||
for (const item of dataTransfer.items) { | ||
const entries = await Promise.all(Array.from(dataTransfer.items, async item => { | ||
var _await$item$getAsFile; | ||
@@ -58,4 +58,14 @@ | ||
const entry = (_await$item$getAsFile = await (item.getAsFileSystemHandle == null ? void 0 : item.getAsFileSystemHandle())) != null ? _await$item$getAsFile : getAsFileSystemHandleFromEntry(item.webkitGetAsEntry(), logDropError); // :entry can be null when we drop the url e.g. | ||
const entry = (_await$item$getAsFile = await (item.getAsFileSystemHandle == null ? void 0 : item.getAsFileSystemHandle())) != null ? _await$item$getAsFile : getAsFileSystemHandleFromEntry(item.webkitGetAsEntry(), logDropError); | ||
return { | ||
lastResortFile, | ||
entry | ||
}; | ||
})); | ||
for (const { | ||
lastResortFile, | ||
entry | ||
} of entries) { | ||
// :entry can be null when we drop the url e.g. | ||
if (entry != null) { | ||
@@ -62,0 +72,0 @@ try { |
{ | ||
"name": "@uppy/utils", | ||
"description": "Shared utility functions for Uppy Core and plugins maintained by the Uppy team.", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -44,6 +44,11 @@ import getRelativePath from './getRelativePath.js' | ||
export default async function* getFilesFromDataTransfer (dataTransfer, logDropError) { | ||
for (const item of dataTransfer.items) { | ||
const entries = await Promise.all(Array.from(dataTransfer.items, async item => { | ||
const lastResortFile = item.getAsFile() // Chromium bug, see https://github.com/transloadit/uppy/issues/3505. | ||
const entry = await item.getAsFileSystemHandle?.() | ||
?? getAsFileSystemHandleFromEntry(item.webkitGetAsEntry(), logDropError) | ||
return { lastResortFile, entry } | ||
})) | ||
for (const { lastResortFile, entry } of entries) { | ||
// :entry can be null when we drop the url e.g. | ||
@@ -50,0 +55,0 @@ if (entry != null) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
237698
3293