user984003
user984003

Reputation: 29557

jQuery sortable: list elements jump when one element is dragged

I am using jQuery's sortable to move elements between two lists.

My issue is that the list shifts (all the elements down, then back up) when I drag an element. This seems to happen only when there is text (or another element) inside the sortable element.

In this example http://jsfiddle.net/vrCC7/2/:

Code:

    <div id = "containment">
    <ul class = "sortable connectedSortable"  >

        <li class = "child">1</li>
        <li class = "child">2</li>
        <li class = "child">3</li>
    </ul>

    <ul class = "sortable connectedSortable"  >
        <li class = "child"></li>
        <li class = "child"></li>
        <li class = "child"></li>
    </ul>

    </div>

Upvotes: 2

Views: 2975

Answers (2)

ucMax
ucMax

Reputation: 5458

For me, the problem came from css overflow on list :

ul {
    overflow: auto;
}

Upvotes: 0

Rapha&#235;l Althaus
Rapha&#235;l Althaus

Reputation: 60493

just add a

vertical-align:bottom;

in child class seems to do the trick.

see jsFiddle

Upvotes: 4

Related Questions