Skip to content

Commit

Permalink
fix(virtual-scroll): remove duplicate items
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 9, 2017
1 parent 5a895bb commit f893aa6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/virtual-scroll/virtual-scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
_nodes: VirtualNode[] = [];
_vHeight: number = 0;
_lastCheck: number = 0;
_recordSize: number = 0;
_data: VirtualData = {
scrollTop: 0,
};
_queue: number = SCROLL_QUEUE_NO_CHANGES;


_virtualTrackBy: TrackByFn;

@ContentChild(VirtualItem) _itmTmp: VirtualItem;
Expand Down Expand Up @@ -445,7 +445,7 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {

let needClean = false;
if (changes) {
var lastRecord = this.lastRecord() + 1;
var lastRecord = this._recordSize;

This comment has been minimized.

Copy link
@masimplo

masimplo Jul 7, 2017

Contributor

@manucorporat changing this line cancels the optimisation done by PR #11297 making virtual-scroll unusable for lists that their items change.


changes.forEachOperation((_, pindex, cindex) => {

Expand All @@ -465,6 +465,7 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
} else {
needClean = true;
}
this._recordSize = this._records.length;

this.readUpdate(needClean);
this.writeUpdate(needClean);
Expand Down

0 comments on commit f893aa6

Please sign in to comment.