jquery sortable placeholder height problem jquery sortable placeholder height problem jquery jquery

jquery sortable placeholder height problem


I usually solve this by binding a callback that sets the height of the placeholder to the height of the item being sorted to the start event. It's a simple solution that gives you fine-grained control over how you want your placeholder to be displayed.

$( ".column" ).sortable({    connectWith: ".column",    start: function(e, ui){        ui.placeholder.height(ui.item.height());    }});

See updated test case


Have you tried setting the forcePlaceholderSize:true property? Have a read on the jQuery UI Sortable documentation page.


Are your elements display: block ? Inline elements might make the placeholder not keep the height correctly. Eg. this jsFiddle seems to have a similar problem to the one you described. Adding display: block to the .portlet class fixes it.