@@ -419,8 +419,9 @@ export class GridStack {
419419 /**
420420 * Gets current cell height.
421421 */
422- public getCellHeight ( ) : number {
423- if ( this . opts . cellHeight && this . opts . cellHeight !== 'auto' ) {
422+ public getCellHeight ( forcePixel = false ) : number {
423+ if ( this . opts . cellHeight && this . opts . cellHeight !== 'auto' &&
424+ ( ! forcePixel || ! this . opts . cellHeightUnit || this . opts . cellHeightUnit === 'px' ) ) {
424425 return this . opts . cellHeight as number ;
425426 }
426427 // else get first cell height
@@ -1209,7 +1210,7 @@ export class GridStack {
12091210 this . engine . cleanNodes ( ) ;
12101211 this . engine . beginUpdate ( node ) ;
12111212 cellWidth = this . cellWidth ( ) ;
1212- cellHeight = this . getCellHeight ( ) ;
1213+ cellHeight = this . getCellHeight ( true ) ; // force pixels for calculations
12131214
12141215 this . placeholder . setAttribute ( 'data-gs-x' , target . getAttribute ( 'data-gs-x' ) ) ;
12151216 this . placeholder . setAttribute ( 'data-gs-y' , target . getAttribute ( 'data-gs-y' ) ) ;
@@ -1222,7 +1223,6 @@ export class GridStack {
12221223 node . _beforeDragY = node . y ;
12231224 node . _prevYPix = ui . position . top ;
12241225
1225- // mineHeight - Each row is cellHeight + margin
12261226 this . dd . resizable ( el , 'option' , 'minWidth' , cellWidth * ( node . minWidth || 1 ) ) ;
12271227 this . dd . resizable ( el , 'option' , 'minHeight' , cellHeight * ( node . minHeight || 1 ) ) ;
12281228 }
0 commit comments