Search code examples
jquerycssjquery-uijquery-ui-sortablecolumn-count

Unexpected height of li element in jquery sortable plugin


I have used this plugin and it works great but one small bug I am facing is that li element gets unexpected height. You can replicate issue by following steps: 1. Open sortable demo in Internet Explorer and inspect on ul list. 2. From developer tools css add below css to '#sortable' to divide this list in 2 columns

column-count: 2;
-moz-column-count: 2;
-webkit-column-count: 2;
column-gap: 0em;
-moz-column-gap: 0em;
-webkit-column-gap: 0em;
  1. now observe that 4th element got divided by half on each side, try dragging the 4th item in list and observe height of li element

Link to sortable plugin: jQuery-ui-Sortable Demo

Hoping for quick fix for this.


Solution

  • #sortable li {
       break-inside: avoid;
    }
    

    adding break-inside to li solved my problem.