Skip to content

Commit c552504

Browse files
crisbetojelbourn
authored andcommitted
fix(scrolling): provide virtual scroll viewport as scrollable (#14168)
Since the `CdkVirtualScrollViewport` extends `CdkScrollable`, it should also provide itself as a `CdkScrollable` to DI.
1 parent dc6b124 commit c552504

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cdk/scrolling/virtual-scroll-viewport.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ function rangesEqual(r1: ListRange, r2: ListRange): boolean {
5050
},
5151
encapsulation: ViewEncapsulation.None,
5252
changeDetection: ChangeDetectionStrategy.OnPush,
53+
providers: [{
54+
provide: CdkScrollable,
55+
useExisting: CdkVirtualScrollViewport,
56+
}]
5357
})
5458
export class CdkVirtualScrollViewport extends CdkScrollable implements OnInit, OnDestroy {
5559
/** Emits when the viewport is detached from a CdkVirtualForOf. */

0 commit comments

Comments
 (0)