Skip to content

Commit

Permalink
fix(virtual-repeat): stop updating when scrolling passed the list
Browse files Browse the repository at this point in the history
  • Loading branch information
martingust committed Mar 25, 2016
1 parent 7857725 commit b7c19e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/virtual-repeat.js
Expand Up @@ -180,6 +180,9 @@ export class VirtualRepeat {
let scrollTop = this._fixedHeightContainer ? this.scrollContainer.scrollTop : pageYOffset - this.topBuffer.offsetTop;
this._first = Math.floor(scrollTop / itemHeight);
this._first = this._first < 0 ? 0 : this._first;
if (this._first > this.items.length - this._viewsLength) {
this._first = this.items.length - this._viewsLength;
}
this._checkScrolling();
// TODO if and else paths do almost same thing, refactor?
// move views down?
Expand Down

0 comments on commit b7c19e6

Please sign in to comment.