diff --git a/components/lib/fileupload/FileUpload.js b/components/lib/fileupload/FileUpload.js index eba2380c8b..3b0f85ec76 100644 --- a/components/lib/fileupload/FileUpload.js +++ b/components/lib/fileupload/FileUpload.js @@ -73,7 +73,7 @@ export const FileUpload = React.memo( const onFileSelect = (event) => { // give caller a chance to stop the selection - if (props.onBeforeSelect && props.onBeforeSelect(event) === false) { + if (props.onBeforeSelect && props.onBeforeSelect({ originalEvent: event, files: filesState }) === false) { return; } diff --git a/components/lib/fileupload/fileupload.d.ts b/components/lib/fileupload/fileupload.d.ts index 6d836e8988..f9a4dec3c5 100644 --- a/components/lib/fileupload/fileupload.d.ts +++ b/components/lib/fileupload/fileupload.d.ts @@ -59,7 +59,7 @@ interface FileUploadUploadParams extends FileUploadFilesParam { interface FileUploadErrorParams extends FileUploadUploadParams {} interface FileUploadSelectParams extends FileUploadFilesParam { - originalEvent: React.SyntheticEvent; + originalEvent: React.ChangeEvent | DragEvent; } interface FileUploadProgressParams {