Jquery UI Sortable width is incorrect when dragging an element with a inline width percentage -
i using jquery ui sortable sort group of divs percentage widths not known before run time. therefore setting them via inline style.
the issue when sortable div dragged it's width not calculated , set accordingly stretches percentage of wrong element.
is bug in jquery ui or missing something?
here simplified html
<div id="container"> <div id="maincolumn"> <div style="width:80%;" class="sortableitem"> item 1 needs 80% width </div> <div style="width:100%;" class="sortableitem"> item 2 needs 100% width </div> <div style="width:50%;" class="sortableitem"> item 3 needs 50% width </div> </div>
here fiddle shows issue https://jsfiddle.net/qkunja68/ when dragging 3 items not keep width.
you can set forcehelpersize property of sortable object true when call sortable()
i changed fiddle javascript code work
$('#maincolumn').sortable({ items:'.sortableitem', forcehelpersize: true });
Comments
Post a Comment