You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

rodrigo-sheetgo's avatar
rodrigo-sheetgo
Explorer | Level 4
5 years ago

Embedder embed function unmount after target element was unmounted

Hey community,

 

I'm currently implementing the Embedder folowing along with the documentation. We decided to implement it with the "using JavaScript" method. It's working really fine as the example describes:

 

Dropbox.embed({link:"https://www.dropbox.com/sh/keptcjl08q3wsid/AACui966iXcXPbagCJ2py2L-a?dl=0"}, element

 

But unfortunately as we are using a JS Library for our app, as soon as the component which calls the embed function gets unmounted (and along with it the element which we called in the embed function as well), we start receiving a lot of warnings in console and it doesn't stops:

 

Uncaught Error: iframe does not contain a contentWindow
at dropins.js:1
at n (dropins.js:1)

 

So my question is, and what I've already tried, is to have a function which I could maybe call after my component gets unmounted to fire to embed to stop trying watching this element. Is there something like this already? I tried some methods of the Object like unmount and I don't have any success until now.

 

Thanks!

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Thanks for the report! We're aware of this issue and are looking into how to solve it. (We may offer a new method for cleaning up the Embedder after unmounting, or possibly handle this automatically, if possible.) I'll follow up here once I have an update on this.

    • rodrigo-sheetgo's avatar
      rodrigo-sheetgo
      Explorer | Level 4

      Hey Greg,

       

      cool! Happy to hear that you are already working on this! I'm looking forward to a solution and I'll keep the eyes here on the thread. Would be happy to be informed as soon as it is solved. Thanks again!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!