Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

event.dataTransfer.dropEffect in chrome

I have a script which determines the result of drag and drop operation from the value of event.dataTransfer.dropEffect. I set the property event.dataTransfer.effectAllowed to value "copymove". In Firefox the value of dropEffect is "move" by default and "copy" when I press ctrl key during drag. In Chrome, the value of dropEffect is always "none". Does Chrome not suppot this API?

like image 457
jlx84 Avatar asked Sep 25 '13 16:09

jlx84


1 Answers

This is a bug in Chrome (and in Internet Explorer). For Chrome there is a bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=39399

As a solution you must store the content of dropEffect in a global variable while the drag events and use its content instead of event.dataTransfer.dropEffect if that value is "none" in the drop event.

like image 56
David Gausmann Avatar answered Oct 06 '22 23:10

David Gausmann