Opened 14 years ago
Closed 10 years ago
#4741 closed bug (duplicate)
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.
- _contactContainers: this one is fine - it properly moves an item only into the innermost container
- _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.
Change History (12)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
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.
comment:3 Changed 14 years ago by
Milestone: | TBD → 1.8 |
---|
comment:5 Changed 13 years ago by
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?
comment:6 Changed 12 years ago by
I also have the same problem, using nested sortables. Any workaround would be greatly appreciated.
comment:7 Changed 12 years ago by
Yes, I am seeing this issue as well. Is there a work around right now?
comment:8 Changed 12 years ago by
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).
comment:9 Changed 11 years ago by
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.
comment:10 Changed 11 years ago by
After further testing the patch introduces crazy flickers at the same level in my case. Going to continue to search for a viable solution.
comment:11 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
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.