Topic: MDBFileUpload how to detect click event for Remove button
clickstudioltd priority asked 2 years ago
Expected behavior
Be able to intercept click event for Remove button, so we can know when the user wants to delete an existing file like an already uploaded profile picture, and therefore pass a parameter to the server server side upon submit.
Actual behavior
- I wish there was a method like
onRemoveClick
or even a reference to the Remove button to alleviate this issue, but there is none. - Right now, the only way that we can know Remove is clicked is by
getInputFiles
method which only gets called when you have chosen a file via the component itself and not when you have adefaultFile
already in place. This method also gets called twice with an empty array passed to it upon first visit to the page, probably due to a rerender but I don't think it should be called upon a rerender.
Resources (screenshots, code snippets etc.)
Wojciech Staniszewski staff answered 2 years ago
We will add such an event in the next release. Thank you for the suggestion.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB React
- MDB Version: MDB5 3.0.0
- Device: PC
- Browser: Mozilla Firefox
- OS: Windows 10
- Provided sample code: Yes
- Provided link: No