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
511511 }
512512
513513 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.
514517 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+
515525 afterNextRender (
516526 ( ) => {
517527 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 ;
523528 const runAfterChangeDetection = this . _runAfterChangeDetection ;
524529 this . _runAfterChangeDetection = [ ] ;
525530 for ( const fn of runAfterChangeDetection ) {
You can’t perform that action at this time.
0 commit comments