jQueryUI Sortable Item Incorrect Position While Dragging

javascript, jquery, jquery-ui, twitter-bootstrap

Solution

I had a similar problem, setting the helper to clone mode worked for me:

$('#sortable').sortable({
    helper: 'clone'
});

Problem

I have a jQueryUI sortable list which contains three `bootstrap` panels, panels 1 and 2 start dragging with the correct initial positions, however whenever you try to drag panel 3 it drops under panel 1 offset from the cursor. Live demo HTML ``` <ul id="sortable"> <li class="col-xs-4"> <div class="panel panel-default"> <div class="panel-heading ui-sortable-handle">1</div> <div class="panel-body"></div> </div> </li> <li class="col-xs-4"> <div class="panel panel-default"> <div class="panel-heading ui-sortable-handle">2</div> <div class="panel-body"></div> </div> </li> <li class="col-xs-4"> <div class="panel panel-default"> <div class="panel-heading ui-sortable-handle">3</div> <div class="panel-body"></div> </div> </li> </ul> ``` JavaScript ``` $('#sortable').sortable({ tolerance: 'pointer', handle: '.panel-heading', placeholder: 'col-xs-4 panel-al-placeholder', start: function (e, ui) { ui.placeholder.height(ui.item.children().height()); } }); ``` CSS ``` ul { width: 650px; list-style: none; padding: 0; margin: 0; } .panel-al-placeholder { margin-bottom: 18px; border:2px solid #f8e287; background:#fef9e7 } ```

Original source