fix(virtualscroll): Populate nodes at correct height

This commit is contained in:
Michael Asimakopoulos
2017-01-30 12:07:41 +02:00
parent eba0866a34
commit 51c398d614

View File

@ -432,7 +432,8 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
writeUpdate() {
console.debug(`virtual-scroll, writeUpdate`);
processRecords(this._data.renderHeight,
const stopAtHeight = ((this._data.scrollTop || 0) + this._data.renderHeight);
processRecords(stopAtHeight,
this._records,
this._cells,
this._hdrFn,
@ -458,10 +459,11 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
const records = this._records;
// initialize nodes with the correct cell data
data.topCell = 0;
adjustRendered(cells, data);
data.bottomCell = (cells.length - 1);
populateNodeData(0, data.bottomCell,
populateNodeData(data.topCell || 0,
data.bottomCell,
data.viewWidth, true,
cells, records, nodes,
this._itmTmp.viewContainer,