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 da1b1f6999
commit e62cf4c2f7
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]);
}
}