Opened 13 years ago

Closed 12 years ago

#1849 closed defect (fixed)

HtmlDragSource object jumps to 0,0 of browser (upper left) when drag begin

Reported by: guest Owned by: psowden
Priority: high Milestone: 1.0
Component: DnD Version: 0.4
Keywords: dnd jumps drag Cc: bigtoe416@…
Blocked By: Blocking:

Description

I have two images that are both HtmlDragSource? objects. When I drag the second one it correctly begins to move the image from its location on the page. On Firefox 2.0, and 1.5, when I begin to drag the first one it jumps to 0,0 before it starts to move with the mouse cursor. On IE 6 I cannot drag the first image at all, only the second. This is pretty horrible looking when the image is on the right side of the page when you begin to drag it since it jumps across the page and looks pretty awful. Simple reproduceable example follows:

<html> <head> <script type="text/javascript" src="/dojo/dojo.js"></script> <script language="JavaScript?" type="text/javascript">

dojo.require("dojo.dnd.*");

function init() {

document.getElementById('image').innerHTML += "<img id='one' src='image-1.jpg'/>"; new dojo.dnd.HtmlDragSource?(document.getElementById("one"), "*"); document.getElementById('image').innerHTML += "<img id='two' src='image-2.jpg'/>"; new dojo.dnd.HtmlDragSource?(document.getElementById("two"), "*");

} </script> </head> <body onload="init();">

<ul id="image"> </ul>

</body> </html>

Attachments (2)

1849.html (719 bytes) - added by bill 13 years ago.
Updated version of test file. (The problem reproduces on FF 1.5, even if the image files aren't present.)
working.html (751 bytes) - added by bill 13 years ago.
Slightly modified version of testcase that works.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by bill

Milestone: 0.4.1
Resolution: fixed
Status: newclosed

This should already be fixed in the latest SVN. Please checkout the latest code and try again.

comment:2 Changed 13 years ago by guest

The 11/8/2006 nightly still has this problem. Does that nightly not reflect the SVN repository?

comment:3 Changed 13 years ago by bill

Resolution: fixed
Status: closedreopened

OK, I'll take a look.

comment:4 Changed 13 years ago by bill

Owner: changed from psowden to bill
Status: reopenednew

Changed 13 years ago by bill

Attachment: 1849.html added

Updated version of test file. (The problem reproduces on FF 1.5, even if the image files aren't present.)

Changed 13 years ago by bill

Attachment: working.html added

Slightly modified version of testcase that works.

comment:5 Changed 13 years ago by bill

Milestone: 0.4.10.6
Owner: changed from bill to psowden

I've investigated this some. It's a corner case; only happens when assigning via innerHTML. If the images are declared in markup then it works fine. And it also works fine if the drag object declaration happens a bit later. I'm attaching a modified version of the testcase that works and deferring the bug. (By the way, the original testcase was putting <img> directly under <ul> which isn't legal.

comment:6 Changed 12 years ago by Eugene Lazutkin

Resolution: fixed
Status: newclosed

Fixed in 0.9.

Note: See TracTickets for help on using tickets.