Skip to main content

Search and Top Navigation

#6817 closed bug (fixed)

Opened January 06, 2011 08:43AM UTC

Closed March 15, 2013 11:02PM UTC

Last modified December 16, 2013 09:28PM UTC

Draggable: auto scroll goes double distance when dragging

Reported by: chrisdew Owned by:
Priority: minor Milestone: 1.10.3
Component: ui.draggable Version: 1.8.7
Keywords: Cc:
Blocked by: Blocking:
Description

Originally posted on http://stackoverflow.com/questions/4606655/jqueryui-auto-scroll-goes-double-distance-when-dragging

I've distilled the problem into the shortest page which exhibits the problem (apologies for inline style).

If you scroll down and drag the 'drag me' title, look how the dragged element zooms away from the cursor. It seems to be moving double the distance (relative to the document) that it needs to.

I have reproduced the problem in IE8, FF3.5 and Chrome. On WinXP and Ubuntu.

From feedback on stackoverflow it looks like I've encountered a bug.

Thanks,

Chris.

<!DOCTYPE html>

<html>

<head>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script>

<script type="text/javascript">

$(document).ready(function() {

$(".draggable").draggable();

});

</script>

</head>

<body>

<div style="width: 100px; height: 1000px; background: green;">

</div>

<h1 class="draggable">drag me</h1>

<div style="width: 100px; height: 1000px; background: green;">

</div>

</body>

</html>

Attachments (0)
Change History (19)

Changed January 06, 2011 08:49AM UTC by chrisdew comment:1

Changed January 06, 2011 03:05PM UTC by chrisdew comment:2

Changed October 11, 2012 02:49PM UTC by scottgonzalez comment:3

milestone: 1.9.02.0.0

Changed October 26, 2012 12:51AM UTC by mikesherov comment:4

resolution: → worksforme
status: newclosed

Thanks for taking the time to contribute to the jQuery UI project! I can no longer reproduce the issue using the latest jQuery and jQuery UI. http://jsfiddle.net/PkfP7/

If you can still reproduce it, please feel free to reply to this ticket with a test case showing the problem. Thanks!

Changed November 12, 2012 02:56PM UTC by maxgalbu comment:5

I can still reproduce it, on the fiddle you provided and even on the jqueryui.com demos:

http://jqueryui.com/draggable/#scroll

Just scroll any element of the three, they all scrolls too much.

Chrome 23, chrome canary, firefox 16.0.2

Changed November 12, 2012 02:59PM UTC by scottgonzalez comment:6

resolution: worksforme
status: closedreopened

Changed November 12, 2012 02:59PM UTC by scottgonzalez comment:7

status: reopenedopen

Changed November 13, 2012 11:39AM UTC by maxgalbu comment:8

with helper:clone the element scrolls fine:

http://jsfiddle.net/maxgalbu/PkfP7/1/

Changed November 13, 2012 01:21PM UTC by tj.vantoll comment:9

summary: draggable - auto scroll goes double distance when draggingDraggable: auto scroll goes double distance when dragging

Changed March 15, 2013 11:02PM UTC by Woody Gilk comment:10

resolution: → fixed
status: openclosed

Draggable: Fix double offset bug when scrolling. Fixes #6817 - Draggable: auto scroll goes double distance when dragging

Changeset: 82f588e82b887fdcb2406da2c5dfedc2f13ebdc9

Changed March 15, 2013 11:05PM UTC by mikesherov comment:11

milestone: 2.0.01.11.0

Changed March 17, 2013 02:34PM UTC by mikesherov comment:12

#5718 is a duplicate of this ticket.

Changed March 17, 2013 02:57PM UTC by mikesherov comment:13

#3740 is a duplicate of this ticket.

Changed April 17, 2013 03:38PM UTC by Woody Gilk comment:14

Draggable: Fix double offset bug when scrolling. Fixes #6817 - Draggable: auto scroll goes double distance when dragging

(cherry picked from commit 82f588e82b887fdcb2406da2c5dfedc2f13ebdc9)

Changeset: 943537cb785fb90adf9f0b515cbb084a1a2e3c04

Changed April 17, 2013 03:40PM UTC by scottgonzalez comment:15

milestone: 1.11.01.10.3

Changed October 02, 2013 06:32PM UTC by chrisdew comment:16

Thanks for fixing this. I can confirm that it works properly in 1.10.3.

Changed December 16, 2013 11:23AM UTC by fchateau comment:17

I am astonished that this issue, reported over 5 years ago in ticket 3740 is still occurring in v.1.10.3. And, the script modification that fixed it in 3740 is still fixing it when added to v.1.10.3.

In my case, I have some tables designed to look like list boxes, which scroll through a list of text entries. These text entries are dragged from one box to another. It all functions correctly in Chrome, but breaks as previously described when the list is scrolled in FireFox. To reiterate, this involves a scrolling document containing tables which scroll text.

A small amount of scrolling in the list boxes results in a 300px to 400px offset between the cursor and the helper clone. If anyone is interested, I can grant access to this Web page, so you can experiment with it.

Changed December 16, 2013 01:22PM UTC by tj.vantoll comment:18

Replying to [comment:17 fchateau]:

I am astonished that this issue, reported over 5 years ago in ticket 3740 is still occurring in v.1.10.3. And, the script modification that fixed it in 3740 is still fixing it when added to v.1.10.3. In my case, I have some tables designed to look like list boxes, which scroll through a list of text entries. These text entries are dragged from one box to another. It all functions correctly in Chrome, but breaks as previously described when the list is scrolled in FireFox. To reiterate, this involves a scrolling document containing tables which scroll text. A small amount of scrolling in the list boxes results in a 300px to 400px offset between the cursor and the helper clone. If anyone is interested, I can grant access to this Web page, so you can experiment with it.

This should be fixed in master. See #9315 and try using http://code.jquery.com/ui/jquery-ui-git.js to see if it resolves your issue.

Changed December 16, 2013 09:28PM UTC by fchateau comment:19

I can't believe after 5 years, you guys have finally got this thing right. ;)

Seriously, I think my page design was a extreme test of this draggable functionality. Congratulations on a job well done.