File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -511,15 +511,20 @@ export class CdkVirtualScrollViewport extends CdkVirtualScrollable implements On
511
511
}
512
512
513
513
this . ngZone . run ( ( ) => {
514
+ // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection
515
+ // from the root, since the repeated items are content projected in. Calling `detectChanges`
516
+ // instead does not properly check the projected content.
514
517
this . _changeDetectorRef . markForCheck ( ) ;
518
+
519
+ // Apply the content transform. The transform can't be set via an Angular binding because
520
+ // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of
521
+ // string literals, a variable that can only be 'X' or 'Y', and user input that is run through
522
+ // the `Number` function first to coerce it to a numeric value.
523
+ this . _contentWrapper . nativeElement . style . transform = this . _renderedContentTransform ;
524
+
515
525
afterNextRender (
516
526
( ) => {
517
527
this . _isChangeDetectionPending = false ;
518
- // Apply the content transform. The transform can't be set via an Angular binding because
519
- // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of
520
- // string literals, a variable that can only be 'X' or 'Y', and user input that is run through
521
- // the `Number` function first to coerce it to a numeric value.
522
- this . _contentWrapper . nativeElement . style . transform = this . _renderedContentTransform ;
523
528
const runAfterChangeDetection = this . _runAfterChangeDetection ;
524
529
this . _runAfterChangeDetection = [ ] ;
525
530
for ( const fn of runAfterChangeDetection ) {
You can’t perform that action at this time.
0 commit comments