Bug Tracker

Opened 12 years ago

Closed 10 years ago

Last modified 8 years ago

#2780 closed bug (invalid)

Sortables - Revert

Reported by: wjchristenson2 Owned by: paul
Priority: major Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: Sortable Cc:
Blocked by: Blocking:

Description

If revert is enabled and you drag a sortble item into the slot a sortable item is reverting into, they overlap and it breaks the sortable.

This happens both in FireFox and IE. I disabled revert as a work around. To reproduce, enable revert and drag/drop items very fast into the same location.

Change History (5)

comment:1 Changed 12 years ago by paul

Resolution: worksforme
Status: newclosed

I wasn't able to reproduce the issue - can you check if you can reproduce it on http://dev.jquery.com/view/trunk/ui/demos/i.sortable.html? Most of the lists have revert enabled, and I tried dragging really fast. If it still happens for you, please reopen the issue,. Thanks!

comment:2 Changed 11 years ago by dmuir

Resolution: worksforme
Status: closedreopened

I can confirm the behaviour in the original post. Link provided is dead. I'm assuming you meant to link to: http://dev.jquery.com/view/tags/ui/latest/demos/functional/#ui.sortable

The problem occurs when you sort before the revert has had a chance to complete. Not a problem with the connected lists (revert is off) But in the second sortable demo using placeholders, you can get it to stuff up if you click and drag one of the items away, then before it has a chance to return back to its original position, you click and sort another list item. The helper doesn't get destroyed, and the original remains with visibility: hidden

comment:3 Changed 11 years ago by volomike

I can confirm the behavior using FF2 (Windows only) and IE (any version) using jQuery UI 1.6rc2. Once I used FF3 on Ubuntu 8.04, the problem didn't occur, and I suspect because the containment option doesn't work on Linux -- the items move to the left like 100 pixels and it's impossible to click in the way dmuir mentions. It's also a hard problem to reproduce unless you do exactly the kind of clicking that dmuir mentions.

Take the revert property out, and the problem is resolved.

comment:4 Changed 11 years ago by fabien

Hi I can easily reproduce the issue when I move items very fast as mentioned by dmuir. When debugging with Firebug, I can see that items are still here, but hidden. If I remove the "visibility:hidden" property on-the-fly, the item reappears. Sometimes, no item has the "visibility:hidden" property, but the helper is visible, so I just add "visibility:hidden" to the helper and everything goes right again.

Here is a copy-paste of what I have in firebug window:

<ul id="placeholderSortable" class="ui-sortable" style="position: relative;"> <li id="user_1" class="element"> </li> <li id="user_3" class="element" style="visibility: hidden;"> </li> <li id="user_4" class="element"> </li> <li id="user_5" class="element"> </li> <li id="user_6" class="element" style="visibility: hidden;"> </li> <li id="user_6" class="element ui-sortable-helper" style="position: absolute; clear: both; z-index: 1000; left: 440px; top: 200px; visibility: hidden;"> </li> <li id="user_2" class="element" style="visibility: hidden;"> </li> <li id="user_6" class="element ui-sortable-helper" style="position: absolute; clear: both; z-index: 1000; left: 440px; top: 200px;"> </li> <li id="user_2" class="element ui-sortable-helper" style="position: absolute; clear: both; z-index: 1000; left: 640px; top: 200px;"> </li> <li id="user_7" class="element" style=""> </li> <li id="user_8" class="element" style=""> </li> <li id="user_3" class="element ui-sortable-helper" style="position: absolute; clear: both; z-index: 1000; left: 440px; top: 0px;">

You can see that element 2, 3 and 6 are hidden and there are 4 sortable-helpers that are visible but shouldn't.

Hope this will help you to debug.

Of course, when I remove revert:true, everything works fine.

Config : FF 3.0.4, Windows, UI 1.5.3 $("#placeholderSortable").sortable({

placeholder: "ui-selected", revert: true, tolerance:'pointer'

});

comment:5 Changed 10 years ago by john

Resolution: invalid
Status: reopenedclosed
Note: See TracTickets for help on using tickets.