@@ -32,7 +32,7 @@ import { VirtualHelperComponent } from './virtual.helper.component';
3232import { IgxScrollInertiaModule } from './../scroll-inertia/scroll_inertia.directive' ;
3333import { IgxForOfSyncService , IgxForOfScrollSyncService } from './for_of.sync.service' ;
3434import { Subject } from 'rxjs' ;
35- import { takeUntil , filter , throttleTime } from 'rxjs/operators' ;
35+ import { takeUntil , filter , throttleTime , first } from 'rxjs/operators' ;
3636import ResizeObserver from 'resize-observer-polyfill' ;
3737import { IBaseEventArgs } from '../../core/utils' ;
3838import { VirtualHelperBaseDirective } from './base.helper.component' ;
@@ -746,8 +746,8 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
746746 const diffs = [ ] ;
747747 let totalDiff = 0 ;
748748 const l = this . _embeddedViews . length ;
749- this . _embeddedViews . filter ( view => ! view . destroyed ) . forEach ( view => view . detectChanges ( ) ) ;
750- const rNodes = this . _embeddedViews . map ( view => view . rootNodes . find ( node => node . nodeType === Node . ELEMENT_NODE ) ) ;
749+ const rNodes = this . _embeddedViews . map ( view =>
750+ view . rootNodes . find ( node => node . nodeType === Node . ELEMENT_NODE ) || view . rootNodes [ 0 ] . nextElementSibling ) ;
751751 for ( let i = 0 ; i < l ; i ++ ) {
752752 const rNode = rNodes [ i ] ;
753753 if ( rNode ) {
@@ -1558,7 +1558,11 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
15581558 const scrollOffset = this . fixedUpdateAllElements ( this . _virtScrollTop ) ;
15591559
15601560 this . dc . instance . _viewContainer . element . nativeElement . style . top = - ( scrollOffset ) + 'px' ;
1561- this . recalcUpdateSizes ( ) ;
1561+
1562+ this . _zone . onStable . pipe ( first ( ) ) . subscribe ( ( ) => {
1563+ this . recalcUpdateSizes ( ) ;
1564+ } ) ;
1565+ this . cdr . markForCheck ( ) ;
15621566 }
15631567
15641568 onHScroll ( scrollAmount ) {
0 commit comments