Closed devanshitrivedi closed 1 month ago
Hi @devanshitrivedi
Please always try to provide an isolated example so the issue can be processed faster, as this saves us from having to recreate it ourselves.
The onChange
event is only triggered when the input value changes. This applies to native input elements as well as the FileUploader
web component. To resolve this, you can reset the value
prop when a file is removed: https://stackblitz.com/edit/ui5wcr-v1-8qstbs?file=src%2FApp.tsx,package.json
Thank you!
Describe the bug
I'm working with the File Uploader component from ‘ui5-webcomponents-react’ (link). We need to enable the upload of the same file multiple times, as users have the option to remove and re-upload files (see attached screenshot).
Currently, I've noticed that if a file is uploaded and then the same file is uploaded again, the
onChange
method isn't triggered. Is there a workaround for this issue?Isolated Example
No response
Reproduction steps
Expected Behaviour
On change method is called when same file is uploaded again. Or make a prop available in FileUploader component which allows this functionality. Something similar to this: https://github.com/SAP/openui5/blob/master/src/sap.ui.unified/src/sap/ui/unified/FileUploader.js#L133
Screenshots or Videos
https://github.com/user-attachments/assets/c22a0808-e20c-4c7e-8ef0-08b21bb4cd89
UI5 Web Components for React Version
^1.27.1
UI5 Web Components Version
NA
Browser
Chrome
Operating System
No response
Additional Context
No response
Relevant log output
No response
Organization
No response
Declaration