Trigger clear selected

Would it be possible to within the multiple file uploading to clear the chosen files? Simular to what the button ‘remove all’ does in ‘preview’. What function would I need to trigger?

Hi @interate, if I understand you correctly, you’re looking for a way to do the same as the “remove all” button does but programmatically. If so, you can do this using widget.value(null)

const widget = uploadcare.Widget("[role=uploadcare-uploader]");
// when you need to clear the widget
widget.value(null);

Would you mind telling us a little more about the scenario behind your question?

Hi, yes that works to deselect the chosen files/images, but will still be added when clicked on ‘add’. What I try to accomplish is when switching between the upload sources to deselect the selection at the previous source.

Case: User selects images within Instagram, clicks on to Facebook, the previous selected images get deselected (this works) and not downloaded when clicked on ‘add’.

We would also like to be able to deselect images by clicking on an selected image, but that seems impossible?

Thanks for the details! I’m afraid this is not feasible with the current implementation of the widget. By design, it uploads a file immediately once it’s selected by the user. We are going to revise the workflow and make some improvements to the current UX to allow users to select/deselect files and upload only what they have selected. I’ll move this topic to the “Feature Requests” section. Once the update is released, we’ll let you know about it here.

1 Like