Skip to main content

Search and Top Navigation

#4802 closed bug (invalid)

Opened August 25, 2009 11:51AM UTC

Closed November 19, 2012 09:06AM UTC

Last modified December 02, 2016 01:57PM UTC

Sortable: jump when moving element

Reported by: ben_cms Owned by: ben_cms
Priority: major Milestone: 2.0.0
Component: ui.sortable Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

Unfortunately bug #3591 doesn't seem to have gone away... This is the case with long lists of sortable elements.

If you try the sortable demo (http://jqueryui.com/demos/sortable/default.html) you can see it by resizing your browser so that you activate the scrollbar.

Then if you go to the very end of the page and try to move an element you can see a "jump" (it is quite subtle on the demo page) which can be very disturbing when the height of the element is important.

This behaviour occurs in IE7 and FF3 at least.

Attachments (0)
Change History (11)

Changed November 18, 2009 02:00PM UTC by jzaefferer comment:1

milestone: TBD1.8

Changed January 18, 2011 05:44PM UTC by sutherland comment:2

This appears to be an issue in Sortable's _mouseStart().

Here, the sortable helper is absolutely-positioned before the placeholder is created/inserted. This results in a "jump" (as viewed from page bottom) because the document height shrinks when the helper is abs-positioned. One solution: create the placeholder before the helper is abs-positioned. I did a quick test; seems to fix the "jump".

Changed January 27, 2011 10:07AM UTC by honda comment:3

I second that,

issue with scroll jump can be removed simply by moving 'this._createPlaceholder();' from line 185(jquery.ui.sortable.js) just before line 156, where helper gets position:absolute.

I have no clue if it affects further offset calculations, but it seems to work for my case with nested sortables.

Other way is to set height of currentItem's parent just before repositioning helper and unset that after creation of placeholder.

Changed October 11, 2012 02:54PM UTC by scottgonzalez comment:4

milestone: 1.9.02.0.0

Changed November 04, 2012 06:41PM UTC by mikesherov comment:5

owner: → ben_cms
status: newpending
summary: Sortable jump when moving elementSortable: jump when moving element

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 using the info provided. http://jqueryui.com/sortable

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

Changed November 19, 2012 09:06AM UTC by trac-o-bot comment:6

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed August 21, 2013 10:36PM UTC by habermann24 comment:7

I just tested this with current jquery ui 1.10.3 and for me the issue still exists.

It is easily fixed by the suggestions above (by moving this._createPlaceholder(); before the absolute positioning of the helper).

As far as i can see, the change doesn't brake anything, so please patch this.

Should i just add a pull request to the github repo?

Changed August 23, 2013 02:06AM UTC by tj.vantoll comment:8

Replying to [comment:7 habermann24]:

I just tested this with current jquery ui 1.10.3 and for me the issue still exists. It is easily fixed by the suggestions above (by moving this._createPlaceholder(); before the absolute positioning of the helper). As far as i can see, the change doesn't brake anything, so please patch this. Should i just add a pull request to the github repo?

Hi habermann24,

We need a reduced test case showing the issue in order to look into this. You can use this to get started http://jsfiddle.net/tj_vantoll/YMnwU/.

Changed May 28, 2014 09:28AM UTC by nsimoes comment:9

I could reproduce this on a project I've been working on.

You can check it out on http://jsfiddle.net/BDNVK/

If you scroll on the list and the try to reorder, the element jumps top. It is achieved by the combination of overflow:auto on the body and position:relative on the container.

Hope it helps...

Changed May 28, 2014 12:28PM UTC by tj.vantoll comment:10

Replying to [comment:9 nsimoes]:

I could reproduce this on a project I've been working on. You can check it out on http://jsfiddle.net/BDNVK/ If you scroll on the list and the try to reorder, the element jumps top. It is achieved by the combination of overflow:auto on the body and position:relative on the container. Hope it helps...

Thanks nsimoes. That problem is covered by #9588, but your test case helps.

Changed December 02, 2016 01:57PM UTC by stereodenis comment:11

The problem still exist...