Skip to main content

Search and Top Navigation

#4231 closed bug (worksforme)

Opened February 25, 2009 02:35PM UTC

Closed October 29, 2012 05:23AM UTC

Last modified November 14, 2012 11:43AM UTC

Sortable: not working if scrollbar on page (and scrolled down (once?))

Reported by: studlyswissdude2 Owned by: jzaefferer
Priority: major Milestone: 2.0.0
Component: ui.sortable Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

I have a couple of <ul>s on a page, all of them contain sortable <li>s. The sortables functionality works fine in FF, however, I am running into a problem in IE7 when the page gets big enough that scrolling appears (I have overflow-y set to auto).

The sortables doesn't seem to be working and instead when trying to drag an item, all the <li>s on the page start flickering (disappearing and appearing again) and the dragging functionality is not working at all.

It seems to be working if I scroll to the bottom of the page and try to sort items then!

Any idea what the problem could be?

Attachments (0)
Change History (18)

Changed February 27, 2009 07:31PM UTC by jzaefferer comment:1

milestone: TBD1.6

Changed March 12, 2009 12:15AM UTC by rdworth comment:2

milestone: 1.61.8

Changed August 21, 2009 02:15PM UTC by paul comment:3

This needa a reduced test case - would you be able to provide a test page for us?

Changed October 22, 2009 09:48AM UTC by superboer12 comment:4

I am also experiencing major problems with sortables in a scrolling container.

I made two simple test pages.

The first test with only draggables and droppable area's:

http://pub.romaww.com/jq/testDrop.html

You can drop the draggables to every droppable, thus working fine.

The second test also uses sortable for the droppable area's.

http://pub.romaww.com/jq/testDropSort.html

Now you can only drop a draggable into the sortable drop area's which are visible at the time the handlers are added. If you scroll down first before adding the handlers it gives the same scenario for the area's which are then visible.

The problem not only occurs when using IE7 but also in other browsers (FF3.5, FF3.0, IE8). Using jQuery 1.3.2 and jQuery ui 1.7.2

Adding handlers using this code:

$(".dropArea").droppable({
	drop: function(ev, ui) { $(ui.draggable).html("dropped"); }
});
$(".dropArea").sortable();
$(".dragArea").draggable({
	connectToSortable: '.dropArea',
	revert: 'invalid',
	helper: 'clone'
});

Changed February 24, 2010 05:30PM UTC by jzaefferer comment:5

owner: → joern.zaefferer
status: newaccepted

Changed February 24, 2010 06:10PM UTC by jzaefferer comment:6

Testcase with 1.8rc2 (thanks Adam): http://jsbin.com/uloya3/8

Changed February 24, 2010 06:23PM UTC by jzaefferer comment:7

summary: Sortables - IE7 not working if scrollbar on pageSortables - not working if scrollbar on page (and scrolled down (once?))

Reproducable in FF3.6 (not IE specific):

http://jsbin.com/uloya3/12

Scroll down half way, then try to drag one item to the left, twice. The first time, nothing happens. The second time, it'll change the dragged item's text to 'dragged', without actually adding something to the sortable.

Changed February 24, 2010 07:27PM UTC by jzaefferer comment:8

Commited visual testcase in r3849.

Changed February 24, 2010 08:11PM UTC by jzaefferer comment:9

milestone: 1.81.next

I can't find any code in draggables or droppables that may be resonposible for handling the scroll offset. Deferring to later release.

Changed October 19, 2010 03:52PM UTC by scottgonzalez comment:10

priority: criticalmajor

Changed November 18, 2011 08:54PM UTC by travisp comment:11

Any updates or workarounds on this? Experiencing this problem in 1.8 and it makes ui-sortable useless for longer lists.

Changed October 03, 2012 03:41PM UTC by scottgonzalez comment:12

milestone: 1.next2.0.0
status: acceptednew

Changed October 29, 2012 05:18AM UTC by mikesherov comment:13

status: newopen
summary: Sortables - not working if scrollbar on page (and scrolled down (once?))Sortable: not working if scrollbar on page (and scrolled down (once?))

Changed October 29, 2012 05:23AM UTC by mikesherov comment:14

resolution: → worksforme
status: openclosed

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/jxkBn/

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

Changed November 06, 2012 10:56AM UTC by halm comment:15

_comment0: I am having the same problem. I created a test instance on jsfiddle: http://jsfiddle.net/halm/Fr7hN/1/ It is possible to copy from the 1st list to the 2nd list, unless you scroll down to the bottom of the 2nd list. \ \ In the jsfiddle example above (http://jsfiddle.net/jxkBn), I can break the example if I remove the line "helper: 'clone'" - after that it is possible to *move* the draggables to the top of the droppable list, but not to the bottom of the droppable list. Which sounds like the same problem I am having.1352199464062689

I am having the same problem. I created a test instance on jsfiddle: http://jsfiddle.net/halm/Fr7hN/1/ It is possible to move items from the 1st list to the 2nd list, unless you scroll down to the bottom of the 2nd list.

In the jsfiddle example above (http://jsfiddle.net/jxkBn), I can break the example if I remove the line "helper: 'clone'" - after that it is possible to *move* the draggables to the top of the droppable list, but not to the bottom of the droppable list. Which sounds like the same problem I am having.

Changed November 06, 2012 12:25PM UTC by halm comment:16

I think I have nailed down where the bug was introduced - in jquery-ui 1.8.12, the following was added to sortable function _refreshPositions:

//We ignore calculating positions of all connected containers when we're not over them
if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
	continue;

If I put this code into 1.8.11 then it stops working.

I must apologise but I do not have time to work out how to fix this bug as I am already way over budget on this task... but I hope this gives you a headstart.

Changed November 13, 2012 02:35AM UTC by tj.vantoll comment:17

@halm Your test case indicates that this is likely a duplicate of #7065.

Changed November 14, 2012 11:43AM UTC by halm comment:18

Replying to [comment:17 tj.vantoll]:

@halm Your test case indicates that this is likely a duplicate of #7065.

Agreed, thanks.