@@ -875,20 +875,20 @@ return $.widget( "ui.sortable", $.ui.mouse, {
875875
876876 _createPlaceholder : function ( that ) {
877877 that = that || this ;
878- var className ,
878+ var className , nodeName ,
879879 o = that . options ;
880880
881881 if ( ! o . placeholder || o . placeholder . constructor === String ) {
882882 className = o . placeholder ;
883+ nodeName = that . currentItem [ 0 ] . nodeName . toLowerCase ( ) ;
883884 o . placeholder = {
884885 element : function ( ) {
885886
886- var nodeName = that . currentItem [ 0 ] . nodeName . toLowerCase ( ) ,
887- element = $ ( "<" + nodeName + ">" , that . document [ 0 ] ) ;
887+ var element = $ ( "<" + nodeName + ">" , that . document [ 0 ] ) ;
888888
889- that . _addClass ( element , "ui-sortable-placeholder" ,
890- className || that . currentItem [ 0 ] . className )
891- . _removeClass ( element , "ui-sortable-helper" ) ;
889+ that . _addClass ( element , "ui-sortable-placeholder" ,
890+ className || that . currentItem [ 0 ] . className )
891+ . _removeClass ( element , "ui-sortable-helper" ) ;
892892
893893 if ( nodeName === "tbody" ) {
894894 that . _createTrPlaceholder (
@@ -917,9 +917,15 @@ return $.widget( "ui.sortable", $.ui.mouse, {
917917 return ;
918918 }
919919
920- //If the element doesn't have a actual height by itself (without styles coming
921- // from a stylesheet), it receives the inline height from the dragged item
922- if ( ! p . height ( ) ) {
920+ // If the element doesn't have a actual height or width by itself (without
921+ // styles coming from a stylesheet), it receives the inline height and width
922+ // from the dragged item. Or, if it's a tbody or tr, it's going to have a height
923+ // anyway since we're populating them with <td>s above, but they're unlikely to
924+ // be the correct height on their own if the row heights are dynamic, so we'll
925+ // always assign the height of the dragged item given forcePlaceholderSize
926+ // is true.
927+ if ( ! p . height ( ) || ( o . forcePlaceholderSize &&
928+ ( nodeName === "tbody" || nodeName === "tr" ) ) ) {
923929 p . height (
924930 that . currentItem . innerHeight ( ) -
925931 parseInt ( that . currentItem . css ( "paddingTop" ) || 0 , 10 ) -
0 commit comments