Skip to content

virtual scroll: sticky header/footer #11621

Closed
@amcdnl

Description

@amcdnl

Requirement

We need the ability to make things sticky within the virtual scroll area. This directly relates to sticky header/footer/rows in the table.

API

An idea for the API would be to expose a new content projection area like:

  <cdk-virtual-scroll-viewport [itemSize]="35">
    <cdk-virtual-scroll-sticky position="start">
      MY HEADER
    </cdk-virtual-scroll-sticky>
    <div *cdkVirtualFor="let row of rows$ | async">
    </div>
    <cdk-virtual-scroll-sticky position="end">
      MY FOOTER
    </cdk-virtual-scroll-sticky>
</cdk-virtual-scroll-viewport>

Then we could set position sticky to those sticky projections. One issue with this approach is how do we tell the cdk-virtual-scroll-content-wrapper to accommodate the offset of the header/footer?

Metadata

Metadata

Assignees

Labels

featureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions