Topic: Problem with "getInputFiles" property in React MDB File Upload Plugin
Alban B. priority asked 2 years ago
Expected behavior
After calling "getInputFiles={(files) => setExcelFile(files)", on successful upload, the uploaded file should no longer persist inside the Plugin and/or the "getInputFiles" should not call the setState more than once.
Actual behavior
The uploaded file remains inside the Plugin component, triggering the "getInputFiles={(files) => setExcelFile(files)" call infinitely and blockin the app, unless manually removed by calling the remove event.
Resources (screenshots, code snippets etc.)
<MDBFileUpload
acceptedExtensions="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
label="Xls Upload"
id="upload"
maxFileQuantity={1}
getInputFiles={(files) => setExcelFile(files)}
/>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Opened
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB React
- MDB Version: MDB5 2.4.0
- Device: Laptop
- Browser: Google Chrome (Build 104.0.5112.81)
- OS: Windows 11
- Provided sample code: No
- Provided link: No
Wojciech Staniszewski staff commented 2 years ago
We will take a look at this problem. The fix will be available soon (probably next release).