filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 76 forks source link

Deselect All on summary view not working when accessed via Custom Source #491

Open lholmes-hl opened 1 year ago

lholmes-hl commented 1 year ago

Expected Behavior

After selecting a file from a Custom Picker Source and clicking the View/Edit Selected Button, after being shown the Selected Files summary view, I would expect that clicking the Deselect All button or removing the file would remove my selected files and redirect back to my source.

Current Behavior

When clicking Deselect All on the Selected Files summary view after selecting a file from a custom source, Filestack switches to the Edit Image view and sits with the in progress circle spinning. An error is displayed in the console. The same issue occurs when clicking the x to remove a file.

Possible Solution

Given the error, it looks like it's trying to call a property on an undefined object. Check for the null/undefined on the object. Not sure if it's redirecting incorrectly however since it's going to the Edit Image view or if that's just where it's hitting the error when passing through.

Steps to Reproduce (for bugs)

  1. Create a custom source following your tutorial or use your example custom source plugin.
  2. Select a file & click View/Edit Selected.
  3. On the Selected Files summary view, click Deselect All or click the x to the right of the file to remove it.

Additional Screenshots

  1. Deselect All or the remove x: Filestack_click_errors
  2. Current behavior leads to this: image
  3. Console error: image
  4. It seems to be going through some kind of render function twice. The second time through, e.file is undefined. image

Context

A custom source should function similar to other sources like local_file_system or url. At the very least, it shouldn't cause an error.

Your Environment