this.refs.dropzone.open() can't get invoked in a Promise().then()
See original GitHub issueTo 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.
Issue Analytics
- State:
- Created 8 years ago
- Comments:16
Top Results From Across the Web
Return promise on an event - javascript - Stack Overflow
Return promise inside the event like dropZone.addEventListener('drop', function(event) { return new Promise(function(resolve, ...
Read more >react-dropzone
Simple React hook to create a HTML5-compliant drag'n'drop zone for files. ... IMPORTANT: do not set the ref prop on the elements where...
Read more >react-dropzone - npm
Start using react-dropzone in your project by running `npm i ... getInputProps() props are set, instead, get the refs from the hook itself:....
Read more >Migration Guide | Cypress Documentation
Migrating to Cypress 12.0 This guide details the changes and how to change your code to migrate to Cypress version 12.0.
Read more >Dropzone - Mantine
Dropzone lets you capture one or more files from user. ... To open files browser from outside of component use openRef prop to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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?