handleUpload($event) gets triggerd twice
See original GitHub issueHi,
I’m using the more “advanced” way of your ngx-uploader. So I have the autoUpload
set to false
.
And when I click a button, I trigger the startUpload
event. The thing is, the handleUpload
method is triggered twice… I have no idea why this is happening to be honest.
The code I’m using is almost exact the same as your example.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
File input triggers change event twice (or more) - Stack Overflow
When you click on the #holder a file explorer pops up. But selecting a file triggers the console.log() line to be executed twice...
Read more >Triggered twice - When an event is added, updated
Hi, When an event is created (via OWA) in a calendar, the "When an event is added, updated or deleted (V3)" event is...
Read more >Click event triggering twice. #4101 - JedWatson/react-select
Appears that I am getting an error in the console: [Intervention] Unable to preventDefault inside passive event listener due to target being ...
Read more >Event and Business obejct triggered twice - SAP Community
The event TERMINATE_WORKFLOW and Business object APPR_DOC is triggered.My issue is it is getting triggred twice.So when i link my workf.
Read more >'select' event triggered automatically, and twice - jQWidgets
... able to determine), the 'select' event is triggered automatically immediately after populating the list, and is also triggered twice.
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
OK, I figured out what’s actually causing these multiple uploads. I haven’t looked into the source code, but to trigger multiple uploaded… just try this.
Then click on your upload button, you’ll notice multiple uploads being fired. So… for some reason the “select a file” events are being stored and on upload all fired again, pretty strange behavior.
Gonna look into the source code after this weekend trying to figure out how to solve this. Keep you guys posted.
For me this method is always triggered many times and how many depends on file size. As you can see below this method is also triggered during upload with %, not only at the end (success/error)
and output from console: