We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db4920b commit 29020dcCopy full SHA for 29020dc
components/fields/FileField.js
@@ -38,16 +38,16 @@ export default class FileField extends React.Component {
38
});
39
}
40
41
- onChange(e) {
+ async onChange(e) {
42
if (e.currentTarget.files.length === 0) {
43
return;
44
45
const { multiple, onChange } = this.props;
46
const nativeArray = [...e.currentTarget.files]
47
if (multiple) {
48
- onChange(Promise.all(nativeArray.map(this.uploadFile)))
+ onChange(await Promise.all(nativeArray.map(this.uploadFile)))
49
} else if (nativeArray.length) {
50
- onChange(this.uploadFile(nativeArray[0]));
+ onChange(await this.uploadFile(nativeArray[0]));
51
} else {
52
onChange({ name: "", size: 0, type: "", data: "" });
53
0 commit comments