fix(ui5-file-uploader): setting the value to an empty string also res… #1715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently it is not possible to upload the same file twice in a row, as the
change
event is never fired. There are use cases when the user uploaded a file, then removed it (f.e. from the UploadCollection) and then they try to upload the same file again. However, nothing happens as nochange
event is fired form the nativeinput
. Even if the developer setsvalue
to an empty string, this only affectsui5-file-uploader
, but does not affect the nativeinput
in any way, so it's stuck with the old file despite the fact thatui5-file-uploader
looks empty to the user.The implementation is in
onAfterRendering
for a reason. The native file input'svalue
property is read-only, but can be set to an empty string, and only to that, so it's almost like a public method. Trying to bind this property is problematic, becauselit-html
should never try to change it, but only to set it to an empty string, which makes it hard to keep the state up to date. Therefore it's safest to do this imperatively.In addition: The UploadCollection sample was updated to reset the file uploader each time the user uploads a file, so they can upload the same file twice now.
closes: #1709