Yuvaleros/material-ui-dropzone

onChange for DropzoneDialog component

jackHedaya opened this issue · 2 comments

Feature Request

Describe the problem related to this feature request

I am using the Dropzone dialog because it has the best UX for my application. However, I only plan on using one file. I'd like to be able to trigger onSave when a file is uploaded as opposed to when the submit button is pressed.

Describe the solution you'd like

A method to be called whenever a user uploads one or many files but before pressing submit.

Describe alternatives you've considered

I have considered using onChange in the Dropzone dialog but read in source code that it is only used internally.

Teachability, Documentation, Adoption, Migration Strategy

An addition to onChange for the Dropzone dialog.

Additional context

N/A

Hi @jackHedaya ,

Thanks for your feedback, I had to implement a similar use-case some time ago and I ended up using onDrop to intercept the event of the file being dropped inside the Dropzone and then closing the dialog by setting the open prop to false.

Let me know if this helps you.

Thank you @panz3r! onDrop works fine for this.