-
Notifications
You must be signed in to change notification settings - Fork 375
feat(MultiFileUpload): added event param to onFileDrop #8995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { | |
| HelperText, | ||
| HelperTextItem | ||
| } from '@patternfly/react-core'; | ||
| import { DropEvent } from 'react-dropzone'; | ||
| import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon'; | ||
|
|
||
| interface readFile { | ||
|
|
@@ -68,7 +69,7 @@ export const MultipleFileUploadBasic: React.FunctionComponent = () => { | |
| }; | ||
|
|
||
| // callback that will be called by the react dropzone with the newly dropped file objects | ||
| const handleFileDrop = (droppedFiles: File[]) => { | ||
| const handleFileDrop = (_event: DropEvent, droppedFiles: File[]) => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker for m since this is a limitation of the documentation framework. |
||
| // identify what, if any, files are re-uploads of already uploaded files | ||
| const currentFileNames = currentFiles.map((file) => file.name); | ||
| const reUploads = droppedFiles.filter((droppedFile) => currentFileNames.includes(droppedFile.name)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Thanks for adding that.