Skip to content

Commit

Permalink
🐞 contain top down, not bottom-up. for #185
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Mar 9, 2018
1 parent 1afc9e4 commit 9b8c7eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion draggabilly.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ proto.containDrag = function( axis, drag, grid ) {
var min = applyGrid( -rel, grid, 'ceil' );
var max = this.containSize[ measure ];
max = applyGrid( max, grid, 'floor' );
return Math.min( max, Math.max( min, drag ) );
return Math.max( min, Math.min( max, drag ) );
};

// ----- end event ----- //
Expand Down

0 comments on commit 9b8c7eb

Please sign in to comment.