#5039 closed bug (fixed)
Sortable: does not account for scrolling in positioning
Reported by: | kiechii | Owned by: | Alexander Schmitz |
---|---|---|---|
Priority: | minor | Milestone: | 1.12.0 |
Component: | ui.sortable | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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.
Change History (10)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
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)
$(this.helper).animate({ left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), top: cur.top - this.offset.parent.top - self.margins.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)
and
+ (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))
comment:3 Changed 11 years ago by
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 cur.top 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.
comment:4 Changed 10 years ago by
Milestone: | TBD → 2.0.0 |
---|
comment:5 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | IE 7 Sortable Bug → Sortable: does not account for scrolling in positioning |
No test case, but this is the same issue as #5718
comment:8 Changed 10 years ago by
Reduced test case against master from #9082: http://jsfiddle.net/wjxe4/37/.
comment:9 Changed 7 years ago by
Owner: | set to Alexander Schmitz |
---|---|
Resolution: | → fixed |
Status: | open → closed |
In 9aca706:
comment:10 Changed 7 years ago by
Milestone: | 2.0.0 → 1.12.0 |
---|
Problem also occurs in IE8, whats the ugly hack kiechii? Cheers