mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00
chore(virtual-scroll): only run detection on individual nodes
This commit is contained in:
@ -9,7 +9,7 @@ export class E2EPage {
|
|||||||
items: Array<{id: number, url: string, gif: string}> = [];
|
items: Array<{id: number, url: string, gif: string}> = [];
|
||||||
imgDomain = 'http://localhost:8900';
|
imgDomain = 'http://localhost:8900';
|
||||||
responseDelay = 1500;
|
responseDelay = 1500;
|
||||||
itemCount = 15;
|
itemCount = 1000;
|
||||||
showGifs = false;
|
showGifs = false;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div padding>
|
<div padding>
|
||||||
<code>gulp test.imageserve</code>
|
<code>gulp test.imageserver</code>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ion-list [virtualScroll]="items">
|
<ion-list [virtualScroll]="items">
|
||||||
|
@ -481,7 +481,9 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
|
|||||||
updateNodeContext(nodes, cells, data);
|
updateNodeContext(nodes, cells, data);
|
||||||
|
|
||||||
// ******** DOM WRITE ****************
|
// ******** DOM WRITE ****************
|
||||||
this._cd.detectChanges();
|
for (var i = 0; i < nodes.length; i++) {
|
||||||
|
(<any>nodes[i].view).detectChanges();
|
||||||
|
}
|
||||||
|
|
||||||
// add an element at the end so :last-child css doesn't get messed up
|
// add an element at the end so :last-child css doesn't get messed up
|
||||||
// ******** DOM WRITE ****************
|
// ******** DOM WRITE ****************
|
||||||
@ -613,7 +615,9 @@ export class VirtualScroll implements DoCheck, AfterContentInit, OnDestroy {
|
|||||||
updateNodeContext(nodes, cells, data);
|
updateNodeContext(nodes, cells, data);
|
||||||
|
|
||||||
// ******** DOM WRITE ****************
|
// ******** DOM WRITE ****************
|
||||||
this._cd.detectChanges();
|
for (var i = 0; i < nodes.length; i++) {
|
||||||
|
(<any>nodes[i].view).detectChanges();
|
||||||
|
}
|
||||||
|
|
||||||
// ******** DOM WRITE ****************
|
// ******** DOM WRITE ****************
|
||||||
writeToNodes(nodes, cells, this._records.length);
|
writeToNodes(nodes, cells, this._records.length);
|
||||||
|
Reference in New Issue
Block a user