Skip to content

Commit

Permalink
Infinite files click event handler loop in Edge (#5)
Browse files Browse the repository at this point in the history
Making files click event non bubbling fixes infinite recursion of event handlers calls in Edge.
  • Loading branch information
JanChvala authored and eterna2 committed Jan 24, 2019
1 parent 120df40 commit e7589b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion file-drop-zone.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ <h3>Drop your file here</h3>
this.addEventListener('dragover', e => this._onDragEvent(e));
this.addEventListener('dragleave', e => this._onDragEvent(e));
this.addEventListener('drop', e => this._onFileDrop(e));
Polymer.Gestures.addListener(this, 'tap', e => this.$.files.click());
Polymer.Gestures.addListener(this, 'tap', e => {
this.$.files.dispatchEvent(new MouseEvent("click", { bubbles: false }));
});
}

_onchangeChanged(cb) {
Expand Down

0 comments on commit e7589b9

Please sign in to comment.