DOM only updating last element of the loop while diplaying progress
- Dominant language
- Python
- Stars
- 497
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
I had an issue while diplaying the progress bar in HTML for a bunch of tasks which was being initiated in a loop. While the CeleryProgressBar was initiated for all the tasks, the progress was only being updated for the last task in the loop.
For a quick fix I had to create a function updateElements everytime before onProgress was called.
```
updateElements(){
this.progressBarElement = document.getElementById(this.progressBarElement.getAttribute('id'))
this.progressBarMessageElement = document.getElementById(this.progressBarMessageElement.getAttribute('id'))
}
onData(data) {
let done = false;
if (data.progress) {
this.updateElements()
this.onProgress(this.progressBarElement, this.progressBarMessageElement, data.progress);
}
........
}
```
This solved my issue but would like to know if there is a better solution
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.