@@ -524,7 +524,7 @@ export class GridStackEngine {
524
524
o . pack = true ;
525
525
526
526
// simpler case: move item directly...
527
- if ( ! this . maxRow /* && !this._hasLocked*/ ) {
527
+ if ( ! this . maxRow ) {
528
528
return this . moveNode ( node , o ) ;
529
529
}
530
530
@@ -543,17 +543,14 @@ export class GridStackEngine {
543
543
} ) ;
544
544
if ( ! clonedNode ) return false ;
545
545
546
- let canMove = clone . moveNode ( clonedNode , o ) ;
547
- // if maxRow make sure we are still valid size
548
- if ( this . maxRow && canMove ) {
549
- canMove = ( clone . getRow ( ) <= this . maxRow ) ;
550
- // turns out we can't grow, then see if we can swap instead (ex: full grid) if we're not resizing
551
- if ( ! canMove && ! o . resizing ) {
552
- let collide = this . collide ( node , o ) ;
553
- if ( collide && this . swap ( node , collide ) ) {
554
- this . _notify ( ) ;
555
- return true ;
556
- }
546
+ // make sure we are still valid size
547
+ let canMove = clone . moveNode ( clonedNode , o ) && clone . getRow ( ) <= this . maxRow ;
548
+ // turns out we can't grow, then see if we can swap instead (ex: full grid) if we're not resizing
549
+ if ( ! canMove && ! o . resizing ) {
550
+ let collide = this . collide ( node , o ) ;
551
+ if ( collide && this . swap ( node , collide ) ) {
552
+ this . _notify ( ) ;
553
+ return true ;
557
554
}
558
555
}
559
556
if ( ! canMove ) return false ;
@@ -593,7 +590,7 @@ export class GridStackEngine {
593
590
594
591
/** true if x,y or w,h are different after clamping to min/max */
595
592
public changedPosConstrain ( node : GridStackNode , p : GridStackPosition ) : boolean {
596
- // make sure w,h are set
593
+ // first make sure w,h are set for caller
597
594
p . w = p . w || node . w ;
598
595
p . h = p . h || node . h ;
599
596
if ( node . x !== p . x || node . y !== p . y ) return true ;
0 commit comments