Skip to content

Commit

Permalink
do not prepend if already reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyra Steenbock committed Jun 14, 2018
1 parent aacb5e7 commit 84ab162
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,17 @@ var MasonryComponent = createReactClass({
}

if (diff.prepended.length > 0) {
this.masonry.prepended(diff.prepended);
if (reloadItems) {
this.masonry.reloadItems();
} else {
this.masonry.prepended(diff.prepended);
}

if (this.props.enableResizableChildren) {
diff.prepended.forEach(this.listenToElementResize, this);
}
}

if (reloadItems) {
this.masonry.reloadItems();
}

this.masonry.layout();
},

Expand Down

0 comments on commit 84ab162

Please sign in to comment.