Fix RangeError on non-file drag/drop events (#1498)
ConversationView responds to drag/drop events by forwarding them to its file input. The file input stops propagation and handles the event only if the data transfer is type file. This means that any other data type (text, img, etc...) causes an recursive loop of event propagation, eventually resulting in logging a "RangeError: Maximum call stack size exceeded". Fix by only forwarding files to the file input. // FREEBIE
This commit is contained in:
parent
bd78016120
commit
42f2142e36
1 changed files with 3 additions and 0 deletions
|
@ -208,6 +208,9 @@
|
||||||
'dragleave': 'sendToFileInput'
|
'dragleave': 'sendToFileInput'
|
||||||
},
|
},
|
||||||
sendToFileInput: function(e) {
|
sendToFileInput: function(e) {
|
||||||
|
if (e.originalEvent.dataTransfer.types[0] != 'Files') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.fileInput.$el.trigger(e);
|
this.fileInput.$el.trigger(e);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue