I have the following handler when the file is dropped
onDropHandler(ev) {
console.log({info:'File(s) dropped', ev});
// Prevent default behavior (Prevent file from being opened)
ev.preventDefault();
if (ev.dataTransfer.items) {
// Use DataTransferItemList interface to access the file(s)
for (var i = 0; i < ev.dataTransfer.items.length; i++) {
// If dropped items aren't files, reject them
if (ev.dataTransfer.items[i].kind === 'file') {
var file = ev.dataTransfer.items[i].getAsFile();
console.log({info:'... file[' + i + '].name = ' + file.name, file, ev, len: ev.dataTransfer.items.length});
dropzone__add_dropped_file(file);
}
}
} else {
// Use DataTransfer interface to access the file(s)
for (var i = 0; i < ev.dataTransfer.files.length; i++) {
console.log('... file[' + i + '].name = ' + ev.dataTransfer.files[i].name);
}
}
}
The captured part of the Chrome's console log is shown below. Notice the discrepancy
Any Idea why this is so?
Meaning, I can access the length info via code but can't see it in the structure of the variable ev in the console log. (both logged at the same time). Same issue for the other parts of the ev variables as well.