mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(virtualscroll): Populate nodes at correct height
This commit is contained in:
@ -432,7 +432,8 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
|
|||||||
writeUpdate() {
|
writeUpdate() {
|
||||||
console.debug(`virtual-scroll, writeUpdate`);
|
console.debug(`virtual-scroll, writeUpdate`);
|
||||||
|
|
||||||
processRecords(this._data.renderHeight,
|
const stopAtHeight = ((this._data.scrollTop || 0) + this._data.renderHeight);
|
||||||
|
processRecords(stopAtHeight,
|
||||||
this._records,
|
this._records,
|
||||||
this._cells,
|
this._cells,
|
||||||
this._hdrFn,
|
this._hdrFn,
|
||||||
@ -458,16 +459,17 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
|
|||||||
const records = this._records;
|
const records = this._records;
|
||||||
|
|
||||||
// initialize nodes with the correct cell data
|
// initialize nodes with the correct cell data
|
||||||
data.topCell = 0;
|
adjustRendered(cells, data);
|
||||||
data.bottomCell = (cells.length - 1);
|
data.bottomCell = (cells.length - 1);
|
||||||
|
|
||||||
populateNodeData(0, data.bottomCell,
|
populateNodeData(data.topCell || 0,
|
||||||
data.viewWidth, true,
|
data.bottomCell,
|
||||||
cells, records, nodes,
|
data.viewWidth, true,
|
||||||
this._itmTmp.viewContainer,
|
cells, records, nodes,
|
||||||
this._itmTmp.templateRef,
|
this._itmTmp.viewContainer,
|
||||||
this._hdrTmp && this._hdrTmp.templateRef,
|
this._itmTmp.templateRef,
|
||||||
this._ftrTmp && this._ftrTmp.templateRef, true);
|
this._hdrTmp && this._hdrTmp.templateRef,
|
||||||
|
this._ftrTmp && this._ftrTmp.templateRef, true);
|
||||||
|
|
||||||
// ******** DOM WRITE ****************
|
// ******** DOM WRITE ****************
|
||||||
this._cd.detectChanges();
|
this._cd.detectChanges();
|
||||||
|
Reference in New Issue
Block a user