Skip to content

Commit 9f557b2

Browse files
committed
fix: multiple file upload issue
Resolved a bug where only the first file was uploaded when multiple files were selected. Now, all selected files are uploaded as expected.
1 parent c77378b commit 9f557b2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ should change the heading of the (upcoming) version to include a major version b
2121
## @rjsf/core
2222

2323
- Updated `MultiSchemaField` to call the `onChange` handler after setting the new option, fixing [#3997](https://github.com/rjsf-team/react-jsonschema-form/issues/3977) and [#4314](https://github.com/rjsf-team/react-jsonschema-form/issues/4314)
24+
- Fix an issue where only the first file was uploaded when users selected multiple files for upload.
2425

2526
## @rjsf/utils
2627

packages/core/src/components/widgets/FileWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function FileWidget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends
169169
processFiles(event.target.files).then((filesInfoEvent) => {
170170
const newValue = filesInfoEvent.map((fileInfo) => fileInfo.dataURL);
171171
if (multiple) {
172-
onChange(value.concat(newValue[0]));
172+
onChange(value.concat(newValue));
173173
} else {
174174
onChange(newValue[0]);
175175
}

0 commit comments

Comments
 (0)