Skip to content

Commit

Permalink
fix(scrolling): provide virtual scroll viewport as scrollable (#14168)
Browse files Browse the repository at this point in the history
Since the `CdkVirtualScrollViewport` extends `CdkScrollable`, it should also provide itself as a `CdkScrollable` to DI.
  • Loading branch information
crisbeto authored and jelbourn committed Dec 3, 2018
1 parent dc6b124 commit c552504
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cdk/scrolling/virtual-scroll-viewport.ts
Expand Up @@ -50,6 +50,10 @@ function rangesEqual(r1: ListRange, r2: ListRange): boolean {
},
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [{
provide: CdkScrollable,
useExisting: CdkVirtualScrollViewport,
}]
})
export class CdkVirtualScrollViewport extends CdkScrollable implements OnInit, OnDestroy {
/** Emits when the viewport is detached from a CdkVirtualForOf. */
Expand Down

0 comments on commit c552504

Please sign in to comment.