uploadComplete sends wrong element with multiple file forms on a page.
BoPeng opened this issue · 5 comments
BoPeng commented
When there are multiple file form on a single page, the following scenario will cause uploadComplete
to be triggered with a wrong element.
- Upload a file in the first form. This will result in the creation of a uploaded file with classes
.dff-file .dff-file-id-0
- Upload a file in the second form. This will create another uploaded file with the same class.
- When
uploadComplete
event is triggered, the following line
django-file-form/frontend/src/file_field.ts
Lines 408 to 409 in a63b64b
causes the item from the first uploaded file to be sent. For my application, this causes the customized widget to be added to the wrong uploaded file.
mbraak commented
I'll have a look.
BoPeng commented
Thanks! I can confirm that the PR works.
mbraak commented
Pr 668 is merged. I plan to release a new version of django-file-form this week.
mbraak commented
Version 3.5.2 is released. It includes this fix.