react-dropzone: this.refs.dropzone.open() can't get invoked in a Promise().then()

To reproduce the bug Try this:

new Promise((res, rej) => {
    //Simulate a Async promise
    setTimeout(() => {
        res('ok');
    }, 1000);
})
.then(() => {
   //call dropzone.open in then()
    this.refs.dropzone.open();
});

Nothing happen after open is called.

Help Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16

Commits related to this issue

Most upvoted comments

@bbthorntz For security reasons browser blocks all the popups and dialogues that was opened not directly by user interaction, or those which were opened programmatically but with a delay not greater than 1000 ms. If 1000ms dealy is your usual case, then you probably want to rework UI/UX flow somehow to prevent this, because I am pretty sure that there is no good workaround for this

Here some proofs

It would be great to have it in docs I think. PR?