Permalink
Browse files

fix(virtual-scroll): remove duplicate items

  • Loading branch information...
manucorporat committed May 9, 2017
1 parent 5a895bb commit f893aa677480c8f7f1482324155d92f1d37645d9
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/components/virtual-scroll/virtual-scroll.ts
@@ -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;
@@ -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.

Show comment
Hide comment
@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.

@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) => {
@@ -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);

0 comments on commit f893aa6

Please sign in to comment.