Closed Bug 778700 Opened 12 years ago Closed 12 years ago

"drag" event not fired

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 780526

People

(Reporter: rsr715, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11

Steps to reproduce:

<div id="dr" style="width:50px;height:50px;background: red;position: absolute;" draggable="true"></div>

var $$ = function(el) {
   console.log(document.querySelectorAll(el));
   return document.querySelectorAll(el);
};

document.addEventListener('DOMContentLoaded', function() {
	var el = $$('#dr')[0];
	console.log(el);
   	el.addEventListener('dragstart', function(e){
   		el.style.top = e.clientY+'px';
   		el.style.left = e.clientX+'px';
		console.log(e.clientX);
	});
	el.addEventListener('drag', function(e){
   		el.style.top = e.clientY+'px';
   		el.style.left = e.clientX+'px';
		console.log(e.clientX);
	});
	el.addEventListener('dragend', function(e){
   		el.style.top = e.clientY+'px';
   		el.style.left = e.clientX+'px';
		console.log(e.clientX);
	});
});


Actual results:

"drag" event is not fired.


Expected results:

Element should chnage coords while drag. It works in Chrome.
Component: Untriaged → Drag and Drop
OS: Windows 7 → All
Product: Firefox → Core
Hardware: x86 → All
Version: 14 Branch → Trunk
it is fired if add dataTransfer.setData to dragstart handler

  el.addEventListener('dragstart', function(e){
+      // xxxx something to set dataTransfer
+      e.dataTransfer.setData('Text', e.target.textContent);
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.