filestack-js icon indicating copy to clipboard operation
filestack-js copied to clipboard

Custom source "unmounted" method not called

Open mcjlnrtwcz opened this issue 3 years ago • 1 comments

Expected Behavior

unmounted method of my custom source should be called when I close file picker

Current Behavior

unmounted method of my custom source is not called

Steps to Reproduce (for bugs)

  1. Create a simple custom source like
const myNewCustomSource = {
    label: 'My new Custom Source',
    name: 'myCustomSource',
    icon: '<div />', // irrelevant for this example
    mounted: (element, actions) => {
        console.log("mounted")
    },
    unmounted: (element) => {
       console.log("unmounted")
    }
}
  1. Import and push your custom source to fromSources array in filestack's options
  2. Open the file picker
  3. Select your new custom source
  4. Check console - your new source has been mounted
  5. Close file picker
  6. Check console - you won't see any info that it was unmounted

Context

I am trying to include custom source for filestack in a React app. I should be able to remove my components from the DOM when the user is done with picking the files from my custom source.

Your Environment

  • Version used: 3.25.0
  • Browser Name and version: Chrome
  • Operating System and version (desktop or mobile): macOS 11.6.2

mcjlnrtwcz avatar Jan 20 '22 13:01 mcjlnrtwcz

Same here 🙋‍♂️

pavelmasek avatar Feb 04 '22 15:02 pavelmasek