Skip to main content

Search and Top Navigation

#5039 closed bug (fixed)

Opened January 05, 2010 04:23PM UTC

Closed March 30, 2016 10:53PM UTC

Last modified March 31, 2016 12:44AM UTC

Sortable: does not account for scrolling in positioning

Reported by: kiechii Owned by: arschmitz
Priority: minor Milestone: 1.12.0
Component: ui.sortable Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

in IE7 the jQuery UI is unable to detect page scroll. So if your page is scrolled down and you try to sort the list the item u are sorting will jump up.

For now I wrote a very ugly hack >.< to fix the issue. If anyone needs a temporary fix let me know I will post the ugly hack. But I rather prefer that the issue is fixed the proper way.

Attachments (0)
Change History (10)

Changed February 05, 2010 11:07PM UTC by jazzyCamel comment:1

Problem also occurs in IE8, whats the ugly hack kiechii? Cheers

Changed February 14, 2010 09:41PM UTC by Statocaster comment:2

I solved this problem by commenting out some lines in ui.sortable.js

Find these lines:

(around line: 303 in 1.7.2 or around line: 331 in 1.8rc1)

   left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
   top: - - + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)

and delete or comment out parts at the end of each line:

+ (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft)


+ (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)

I tested it, and it works fine without those parts

(don't forget to keep the comma ',' after the first line (before the 'top' parameter))

Changed January 06, 2012 04:16PM UTC by DSB comment:3

I had a similar issue with jquery ui 1.8.16 and IE 8. When the page is not at the top but scrolled down, the animation of the dropped sortable helper lets it flew to the bottom and out of the page.

The "ugly hack" did the trick for me and corrects the animation.

It looks like and cur.left already hold the absolute offsets. There seems to be no need to add the relative offsets again which will result in too high values.

Changed October 11, 2012 09:07PM UTC by scottgonzalez comment:4

milestone: TBD2.0.0

Changed November 06, 2012 03:09AM UTC by mikesherov comment:5

status: newopen
summary: IE 7 Sortable BugSortable: does not account for scrolling in positioning

No test case, but this is the same issue as #5718

Changed November 17, 2012 03:51AM UTC by tj.vantoll comment:6

#8812 is a duplicate of this ticket.

Changed February 22, 2013 02:44AM UTC by tj.vantoll comment:7

#9082 is a duplicate of this ticket.

Changed February 22, 2013 02:45AM UTC by tj.vantoll comment:8

Reduced test case against master from #9082:

Changed March 30, 2016 10:53PM UTC by arschmitz comment:9

owner: → arschmitz
resolution: → fixed
status: openclosed

In [changeset:"9aca7067321643dcb4b5db03855591c35cd85d69" 9aca706]:

#!CommitTicketReference repository="" revision="9aca7067321643dcb4b5db03855591c35cd85d69"
Sortable: Update _contactContainers to use page clientX/Y values

The sortable was using the window position compared with page position to
determine where to drop objects.  this was only a problem for sortables far
enough down to require scrolling.

Fixes #10727
Fixes #5039
Closes gh-1475
Closes gh-1585

Changed March 31, 2016 12:44AM UTC by scottgonzalez comment:10