filepicker / filepicker-js

Filepicker javascript library
38 stars 15 forks source link

Unable to remove `makeDropPane` event listeners #53

Open lildesert opened 7 years ago

lildesert commented 7 years ago

Hi,

it's impossible to remove the event listeners that are attached in the makeDropPane function : https://github.com/filepicker/filepicker-js/blob/8a92af4609613f4e6def509aafcb113112417553/src/widgets/dragdrop.js#L15

It would be very nice to have a function that clean theses handlers. In my case I use the makeDropPane function on my document element and since the app is an SPA, new event listeners are added each time we load the component that uses filepicker but previous ones are never removed.

To do that you just need to name your functions and then call removeEventListener(event, function)

Thank you !