question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

event.dataTransfer is undefined

See original GitHub issue

Under the last Chrome version, the dataTransfer attribute is undefined on event object.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
larvatacommented, Jul 11, 2014

try this

if (e.dataTransfer) {
    e.dataTransfer.setData('text', id);
}
else if (e.originalEvent.dataTransfer){
    e.originalEvent.dataTransfer.setData('text', id);
}
0reactions
ghostcommented, Mar 20, 2018

@BuonOmo I am having the same issue. I use knockout.js. @larvata solution worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

e.dataTransfer is undefined - Stack Overflow
I added this into my onDragStart function but it tells me that datatrasnfer is undefined: code... onDragStart(event) { event.dataTransfer ...
Read more >
event.dataTransfer is getting undefined in JEST for dragstart
Jest ships with the jsdom and you can see that the dataTransfer is not yet implemented and hence you are receiving the error...
Read more >
file drop event dataTransfer undefined - jQuery - Bug Tracker
e.dataTransfer undefined. } not using jquery: $("#dropbox")[0].addEventListener("drop",function(e){. e.dataTransfer.files works as expected. },false);.
Read more >
DataTransfer.setData() - Web APIs | MDN
The DataTransfer.setData() method sets the ... Return value. None ( undefined ). ... Use the event target's id for the data ev.dataTransfer.
Read more >
Drag and Drop, dataTransfer.getData("URL") returns undefined
Issue 2141: Drag and Drop, dataTransfer.getData("URL") returns undefined ... string) on IE and on Safari). ... the ondrop event. For the most basic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found