[SOLVED]No dataTransferProperty on onDrop event in meteor


Handling drop event there’s no dataTransfer property. Why? Is this a bug or I’m using it incorrectly?

I recreated the issue with a small demo project starting from meteor create test_data_transfer:

main.html is


  <h1>Welcome to Meteor!</h1>

  {{> testDataTransfer}}

<template name="testDataTransfer">
<div id="drop-zone">
  Drop Files Over Here

and main.js is

import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import './main.html';

  'dragover #drop-zone'(e, t) {
  'dragenter #drop-zone'(e, t) {
  'drop #drop-zone'(e, t) {
    console.log("File dropped ..." + (e.dataTransfer ? e.dataTransfer.files[0] : "No data transfer property"));

e.dataTransfer is supposed to be defined when you drop a file over the div.
What’s wrong with my code?


dataTransfer is in e.originalEvent
Take a look on this example: https://github.com/VeliovGroup/Meteor-Files/blob/master/demo/client/upload-form.coffee#L90


I didn’t know that. Thanks :smile: