Fix drag and drop issues on Firefox and Chrome
Review Request #8160 — Created May 12, 2016 and submitted — Latest diff uploaded
In Chrome, the
DataTransfer.files
attribute will not be have a
Symbol.iterator
property, so it cannot be iterated through via
let...of
. In Firefox,DataTransfer.types
is not anarray
(instead,
it is aDOMStringList
) which does not have theincludes
function in
its prototype. We solve both of these issues by usingArray.from
to
coerce these pseudo-arrays into properarray
objects before working
on them.
Verified this drag and drop worked in both Firefox and Chrome with this
patch applied.