Skip to content

Commit

Permalink
🐞 Fix horizontal drag bug
Browse files Browse the repository at this point in the history
Fix bug where you couldn't drag to empty rows
Fixes #365
  • Loading branch information
desandro committed Jun 13, 2016
1 parent f64b0d9 commit c89216b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/packery.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ proto.updateShiftTargets = function( dropItem ) {
boundsSize = ( segs - segmentSpan ) * segment;
// add targets on top
for ( var i=0; i < segs; i++ ) {
this._addShiftTarget( i * segment, 0, boundsSize );
var initialX = isHorizontal ? 0 : i * segment;
var initialY = isHorizontal ? i * segment : 0;
this._addShiftTarget( initialX, initialY, boundsSize );
}
} else {
boundsSize = ( this.shiftPacker[ measure ] + this.gutter ) - dropItem.rect[ measure ];
Expand Down

0 comments on commit c89216b

Please sign in to comment.