uploadcare / file-uploader

Stack-agnostic library for uploading, processing, and editing images on-the-fly
https://uploadcare.com/docs/file-uploader/
MIT License
88 stars 14 forks source link

provide control over resetting internal widget state #407

Closed halafi closed 8 months ago

halafi commented 1 year ago

at the moment if I upload some files, then close the widget and reopen (the same instance and context) I see previously finished state, this is not always desirable (imagine I delete the uploaded file in another way in the meantime)

at the moment I see as the only option to create a new instance of the component each time, maybe there is a better way? also maybe this could be documented

Additional context

uploader

Desired behavior: don't want to see previously uploaded file

nd0ut commented 1 year ago

Hey @halafi,

You can clear the upload list using an undocumented public API. Please refer to https://github.com/uploadcare/blocks/issues/219#issuecomment-1223881802 for more information.

We may implement this feature as a flag in the near future.

nd0ut commented 8 months ago

We've introduced a public removeAllFiles method to clear the upload list. Refer to the docs for more information.