Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#3568 closed bug (fixed)

Drag is jumping with scrollbar

Reported by: zeguizmo Owned by: paul
Priority: critical Milestone: 1.7
Component: ui.draggable Version: 1.6rc2
Keywords: drag scrollbar jump Cc:
Blocked by: Blocking:

Description

Using IE, FF, Chrome, Opera... if there is a vertical scroll bar and I am not at the top of the page, the draggable function does not work properly and it jumps upward the same amount of height as the scroll height.

Here is a video showing the bug in action :

http://www.dubuscyril.com/jquerybug/out.html

In the first part I use the .draggable() function with the scrollbar at the top of the page, it works perfectly, and in the second part I show you the bug.

I use the latest version of jQuery and the latest ui.draggable package. (not the dialog, just draggable)

I hope to hear from you soon because I can't fix it alone,

Thanks a lot,

Guizmo

Attachments (1)

3568.htm (764 bytes) - added by simon 11 years ago.
Fairly minimal file to reproduce.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 11 years ago by Scott González

Milestone: TBD1.6
Priority: minorcritical

comment:2 Changed 11 years ago by simon

I can verify this on IE7. Also reported (incorrectly on the jQuery trac) 2 months ago http://dev.jquery.com/ticket/3384. Is a bit of a showstopper for me at the moment... is there a quick fix?

comment:3 Changed 11 years ago by simon

There is a quick fix if you modify _generatePosition to include

+ ($.browser.msie ? document.documentElement.scrollTop : 0)

for the Y,

+ ($.browser.msie ? document.documentElement.scrollLeft : 0)

for the X into the equations.

comment:4 Changed 11 years ago by zeguizmo

The bug occurs in every browser I have on my system : IE6, IE7, FF2, FF3, Opera, Chrome, Safari, Minefield ...

But I cant reproduce it easily, I think its because of the css complexity and the different relative / absolute position. It's probably a very particular case.

I'll try to reproduce it and find a fix asap, but I'm busy ...

Cheers

comment:5 Changed 11 years ago by simon

I'll try and get a minimal page for reproducing it when I get some time and will attach it here. :)

Changed 11 years ago by simon

Attachment: 3568.htm added

Fairly minimal file to reproduce.

comment:6 Changed 11 years ago by simon

As I stated, taking into account the scrollTop and scrollLeft values in generatePosition seems to fix the issue, but I don't know the codebase well enough to be able to consider side effects of doing this etc.

comment:7 Changed 11 years ago by paul

Resolution: fixed
Status: newclosed

Hi there,

please try the latest trunk version in SVN (or the 1.6rc3 release, following soon), it adresses the issue, and I verified it works correctly using your test file in the reported browsers.

comment:8 Changed 11 years ago by zeguizmo

Hi,

I just tried the new version from the repository, same jumpy behaviour ... It is not the same bug than simon.

My bug occurs on every browsers, not just IE.

I will try to reproduce it in a single page.

I have not the permission to reopen the bug, so please re-open it, because it's not working ! (and the original post was not about the fixed bug).

comment:9 Changed 11 years ago by zeguizmo

Hi/re

I have something solid here. When I put something draggable into something resizable, the bug occurs. In every browser.

BUT it is fixed in one version of jQuery.ui (not the future RC3 !)

Explanations :

I tried first with the automatic RC2 build (from the http://ui.jquery.com/download_builder/) and as you can see here : http://www.dubuscyril.com/jquerybug/jQueryRC2.html the bug occurs.

But to make things clean, I wanted to use the links provided in the example of jQuery.ui documentation, so I made a page with the links like http://code.jquery.com/jquery-latest.js etc ...

And this time, there was no bug !

So I tried to look at the repository, and I found two differents repositories. One at code.google.com. With links like : http://jquery-ui.googlecode.com/svn/tags/latest/ui/ui.core.js With this version, no problem, it works : http://www.dubuscyril.com/jquerybug/jQueryLatest.html

BUT I found another repository for jQuery.ui, the one linked to this bugtracker : http://ui.jquery.com/bugs/browser and it seems up to date I tried sources from this (copy and paste directly from the browser, i'm a bit lazy), and the bug occurs ! As shown here : http://www.dubuscyril.com/jquerybug/jQueryTrunk.html

I think the version from the repository linked to this bugtracker is the future release candidate 3, and with this version the bug occurs, so I think there is some work before the RC3. Please reopen the ticket

I hope it helps !

If you have any question feel free to ask me, my English is very poor and it's hard for me to explain things :)

Cheers,

Guizmo

comment:10 Changed 11 years ago by simon

Just to say apologies to you Guizmo, I misread your bug report and assumed it was the same issue that I was experiencing; I did not mean to invade your bug :)

comment:11 Changed 11 years ago by dave1010

Simon's fix seems to work for me, but the position is then calculated wrongly if the draggable is also droppable. I've tried adding the fix to _generatePosition in droppable too, but it doesn't seem to work.

The problem seems to be just in IE 7 (and IE 6). All other browsers (including IE 8) are fine.

The bug still occurs for me using http://jquery-ui.googlecode.com/svn/tags/latest/ui/ui.draggable.js

Please reopen the ticket

comment:12 Changed 11 years ago by dave1010

This bug was also reported on the jQuery Trac. This ticket contains some more information: http://dev.jquery.com/ticket/3384

comment:13 Changed 11 years ago by bmherold

Just making sure the ticket receives attention. I can report the same problem as dave1010. In IE7, with an item both draggable and droppable, the calculation is off by what looks like the amount scrolled down the page.

Note: See TracTickets for help on using tickets.