Fix double-bound file drop handler

Fixes double-submit after dropping a second file.  Noticed in mail compose, but probably affects everywhere file widget was used to upload
This commit is contained in:
nathan 2023-02-28 10:39:10 -07:00
parent 8d0b1b0234
commit fe2f36d52f
2 changed files with 16 additions and 1 deletions

View File

@ -547,6 +547,21 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
destroy()
{
// Not really needed, use the disconnectedCallback() and let the browser handle it
// Call the destructor of all children so any legacy widgets get destroyed
for(let i = this.getChildren().length - 1; i >= 0; i--)
{
this.getChildren()[i].destroy();
}
// Free the array managers if they belong to this widget
for(let key in this._mgrs)
{
if(this._mgrs[key] && this._mgrs[key].owner == this)
{
delete this._mgrs[key];
}
}
}
isInTree() : boolean

View File

@ -298,7 +298,7 @@ export class et2_file extends et2_inputWidget
let drop_target = widget && widget.getDOMNode() || document.getElementById(this.options.drop_target);
if(drop_target)
{
this.resumable.unAssignDrop(drop_target);
this.resumable.unAssignDrop([drop_target]);
}
}