Opened 16 years ago
Closed 15 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: | [email protected]… |
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)
Change History (8)
comment:1 Changed 16 years ago by
Milestone: | → 0.4.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 Changed 16 years ago by
The 11/8/2006 nightly still has this problem. Does that nightly not reflect the SVN repository?
comment:4 Changed 16 years ago by
Owner: | changed from psowden to bill |
---|---|
Status: | reopened → new |
Changed 16 years ago by
Updated version of test file. (The problem reproduces on FF 1.5, even if the image files aren't present.)
Changed 16 years ago by
Attachment: | working.html added |
---|
Slightly modified version of testcase that works.
comment:5 Changed 16 years ago by
Milestone: | 0.4.1 → 0.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.
This should already be fixed in the latest SVN. Please checkout the latest code and try again.