Skip to main content

Search and Top Navigation

#4741 closed bug (duplicate)

Opened August 03, 2009 01:34PM UTC

Closed November 04, 2012 06:31PM UTC

placeholder flickers between nested levels

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

<ul>

<li>menu 1

<ul>

<li>submenu 1<ul></ul></li>

<li>submenu 2<ul></ul></li>

</ul>

</li>

</ul>

if you create a nested sortable from the above (.sortable() on all <ul>s, then connectWith them together), then drag one of teh inner <li> elements around, you will see it flicker between the different levels of nesting.

the reason for this is that there are two separate loops for finding intersecting lists.

1. _contactContainers: this one is fine - it properly moves an item only into the innermost container

2. _mouseDrag: in here, there is an algorithm which drags the item nest to to the "nearest" intersecting item, but it ignores what container the placeholder is currently in. this is the problem algorithm. When you comment this out, the flickering stops, but obviously, you also lose functionality.

Attachments (0)
Change History (12)

Changed August 03, 2009 01:35PM UTC by kae comment:1

this can be solved by only allowing the placeholder to be moved amidst items in the container it is currently in. apparently, this causes problems, though, with some current code.

Changed August 03, 2009 01:36PM UTC by kae comment:2

I mean, within _mouseDrag, don't allow the algorithm to move the placeholder out of its current container. obviously, the _contactContainers needs to be able to do this.

Changed August 03, 2009 07:01PM UTC by scottgonzalez comment:3

milestone: TBD1.8

Changed June 06, 2010 08:35PM UTC by Heilemann comment:4

Any news on this?

Changed September 28, 2010 07:48AM UTC by webconia comment:5

I have the same problem. This is really annoying, makes it nearly impossible to drag & drop elements from one nested list into a child list.

Is there a plan to fix this bug? Any workarounds known?

Changed November 08, 2010 04:33PM UTC by gmork comment:6

I also have the same problem, using nested sortables. Any workaround would be greatly appreciated.

Changed February 01, 2011 04:56AM UTC by diffident comment:7

Yes, I am seeing this issue as well. Is there a work around right now?

Changed February 01, 2011 05:28AM UTC by diffident comment:8

_comment0: Uncommenting the following line in version 1.8.9 fixed the issue for me: \ \ // && itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container \ \ I wonder what the downside of uncommenting this is. Anyone know? I'm still able to drag items between the nested sortables (which are connected to each other with the connectWith option).1296538135882651

Uncommenting the following line in version 1.8.9 fixed the issue for me:

// && itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container

I wonder what the downside of uncommenting this is. Anyone know? I'm still able to drag items between the nested sortables (which are connected to each other with the connectWith option).

Changed March 28, 2012 04:06PM UTC by MagmaRules comment:9

I'm having the same problem. If i activate the tolerance: "pointer" I end up not being able to drag to "child" sortables at all.

Un-commenting that line allows me to drag from parent sortables to child sortables. However you cannot drag from child sortables to parent sortables.

I found the solution here: https://github.com/jquery/jquery-ui/pull/555

Fixes both problems for me.

Changed March 28, 2012 04:19PM UTC by MagmaRules comment:10

After further testing the patch introduces crazy flickers at the same level in my case. Going to continue to search for a viable solution.

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

milestone: 1.9.02.0.0

Changed November 04, 2012 06:31PM UTC by mikesherov comment:12

resolution: → duplicate
status: newclosed

Duplicate of #4857.