From dbddfe6cda850636c7ef49388773254963e74aa5 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Fri, 24 Jul 2026 08:36:25 -0700 Subject: [PATCH 1/2] Fix multiple file drag-and-drop in dcc.Upload --- .../src/fragments/Upload.react.js | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/components/dash-core-components/src/fragments/Upload.react.js b/components/dash-core-components/src/fragments/Upload.react.js index 0e6b66e30b..62def2927f 100644 --- a/components/dash-core-components/src/fragments/Upload.react.js +++ b/components/dash-core-components/src/fragments/Upload.react.js @@ -111,25 +111,34 @@ export default class Upload extends Component { // Handle drag-and-drop with folder support when multiple=true if (event.dataTransfer && event.dataTransfer.items) { const items = Array.from(event.dataTransfer.items); + + // Get all entries synchronously before the first await + const entries = []; const files = []; for (const item of items) { - if (item.kind === 'file') { - const entry = item.webkitGetAsEntry - ? item.webkitGetAsEntry() - : null; - if (entry) { - const entryFiles = await this.traverseFileTree(entry); - files.push(...entryFiles); - } else { - // Fallback for browsers without webkitGetAsEntry - const file = item.getAsFile(); - if (file) { - files.push(file); - } + if (item.kind !== 'file') { + continue; + } + + const entry = item.webkitGetAsEntry + ? item.webkitGetAsEntry() + : null; + if (entry) { + entries.push(entry); + } else { + // Fallback for browsers without webkitGetAsEntry + const file = item.getAsFile(); + if (file) { + files.push(file); } } } + // Process all entries after collecting them + for (const entry of entries) { + const entryFiles = await this.traverseFileTree(entry); + files.push(...entryFiles); + } return files; } From 0d912b7850c9c6d3d74db4a32e77f76d3dd2ff6e Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Tue, 28 Jul 2026 08:01:28 -0700 Subject: [PATCH 2/2] added changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c4cff63c9..fc0af57c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Removed - [#3646](https://github.com/plotly/dash/pull/3646) Remove React 16 support (`16.14.0` is no longer an accepted value for `REACT_VERSION` / `_set_react_version`). +### Fixed +- [#3916](https://github.com/plotly/dash/pull/3916) Fixed a regression where dragging multiple files into `dcc.Upload` would upload only the first file when `multiple=True` + ## [4.4.1] - 2026-07-21 ## Fixed