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
- chore: update examples documentation Add note about browser block-popup behaviour (relate to https://github.com/react-dropzone/react-dropzone/issues/122) — committed to Nodman/react-dropzone by deleted user 6 years ago
- chore: update examples documentation Add note about browser block-popup behaviour (relate to https://github.com/react-dropzone/react-dropzone/issues/122) — committed to Nodman/react-dropzone by deleted user 6 years ago
- docs: Add a note about async file dialog blocking in modern browsers (#617) Adds a note about modern browsers blocking popup behavior if called programmatically after some delay behind a user interac... — committed to react-dropzone/react-dropzone by Nodman 6 years ago
- docs: Add a note about async file dialog blocking in modern browsers (#617) Adds a note about modern browsers blocking popup behavior if called programmatically after some delay behind a user interac... — committed to sunil-dev7/react-dropzone by sunil-dev7 6 years ago
@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?