Skip to content

Commit

Permalink
Fix #3235: FileUpload proper typing of onSelect event (#3236)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 3, 2022
1 parent be1407d commit b33ea5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/lib/fileupload/FileUpload.js
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion components/lib/fileupload/fileupload.d.ts
Expand Up @@ -59,7 +59,7 @@ interface FileUploadUploadParams extends FileUploadFilesParam {
interface FileUploadErrorParams extends FileUploadUploadParams {}

interface FileUploadSelectParams extends FileUploadFilesParam {
originalEvent: React.SyntheticEvent;
originalEvent: React.ChangeEvent<HTMLInputElement> | DragEvent;
}

interface FileUploadProgressParams {
Expand Down

0 comments on commit b33ea5e

Please sign in to comment.