@@ -419,8 +419,9 @@ export class GridStack {
419
419
/**
420
420
* Gets current cell height.
421
421
*/
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' ) ) {
424
425
return this . opts . cellHeight as number ;
425
426
}
426
427
// else get first cell height
@@ -1209,7 +1210,7 @@ export class GridStack {
1209
1210
this . engine . cleanNodes ( ) ;
1210
1211
this . engine . beginUpdate ( node ) ;
1211
1212
cellWidth = this . cellWidth ( ) ;
1212
- cellHeight = this . getCellHeight ( ) ;
1213
+ cellHeight = this . getCellHeight ( true ) ; // force pixels for calculations
1213
1214
1214
1215
this . placeholder . setAttribute ( 'data-gs-x' , target . getAttribute ( 'data-gs-x' ) ) ;
1215
1216
this . placeholder . setAttribute ( 'data-gs-y' , target . getAttribute ( 'data-gs-y' ) ) ;
@@ -1222,7 +1223,6 @@ export class GridStack {
1222
1223
node . _beforeDragY = node . y ;
1223
1224
node . _prevYPix = ui . position . top ;
1224
1225
1225
- // mineHeight - Each row is cellHeight + margin
1226
1226
this . dd . resizable ( el , 'option' , 'minWidth' , cellWidth * ( node . minWidth || 1 ) ) ;
1227
1227
this . dd . resizable ( el , 'option' , 'minHeight' , cellHeight * ( node . minHeight || 1 ) ) ;
1228
1228
}
0 commit comments