@@ -21,7 +21,7 @@ import {
21
21
ViewEncapsulation ,
22
22
} from '@angular/core' ;
23
23
import { animationFrameScheduler , fromEvent , Observable , Subject } from 'rxjs' ;
24
- import { sampleTime , take , takeUntil } from 'rxjs/operators' ;
24
+ import { sampleTime , takeUntil } from 'rxjs/operators' ;
25
25
import { CdkVirtualForOf } from './virtual-for-of' ;
26
26
import { VIRTUAL_SCROLL_STRATEGY , VirtualScrollStrategy } from './virtual-scroll-strategy' ;
27
27
@@ -301,11 +301,7 @@ export class CdkVirtualScrollViewport implements OnInit, OnDestroy {
301
301
if ( ! this . _isChangeDetectionPending ) {
302
302
this . _isChangeDetectionPending = true ;
303
303
this . _ngZone . runOutsideAngular ( ( ) => Promise . resolve ( ) . then ( ( ) => {
304
- if ( this . _ngZone . isStable ) {
305
- this . _doChangeDetection ( ) ;
306
- } else {
307
- this . _ngZone . onStable . pipe ( take ( 1 ) ) . subscribe ( ( ) => this . _doChangeDetection ( ) ) ;
308
- }
304
+ this . _doChangeDetection ( ) ;
309
305
} ) ) ;
310
306
}
311
307
}
@@ -315,7 +311,7 @@ export class CdkVirtualScrollViewport implements OnInit, OnDestroy {
315
311
this . _isChangeDetectionPending = false ;
316
312
317
313
// Apply changes to Angular bindings.
318
- this . _ngZone . run ( ( ) => this . _changeDetectorRef . detectChanges ( ) ) ;
314
+ this . _ngZone . run ( ( ) => this . _changeDetectorRef . markForCheck ( ) ) ;
319
315
// Apply the content transform. The transform can't be set via an Angular binding because
320
316
// bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of
321
317
// string literals, a variable that can only be 'X' or 'Y', and user input that is run through
0 commit comments