Skip to content

Proposal: a native solution for virtual scrolling #791

@andyearnshaw

Description

@andyearnshaw

This is something that I've proposed as a CSSOM feature, but @annevk suggested I also raise an issue here to widen the discussion. I have a gist detailing the CSSOM proposal.

In brief, virtual scrolling is a feature of very long lists, grids and some other components. You would usually implement it using a custom scrollbar, or using some boilerplate HTML, CSS and JS to hold an element in place and get native scrollbars with the desired scrolling area. The problem with the former is that the experience isn't consistent with native scrollbars and things like touch/momentum scrolling have to be implemented from scratch. The main issue with the native scrollbars approach is that browsers have a limit on the largest size/scroll size a single element can have. A proper solution for virtual scrolling could potentially see scroll sizes of up to Number.MAX_SAFE_INTEGER.

Anne's comment was that there are some elements that scrollbars wouldn't make sense on. He's right, of course, so maybe this could be a feature for Shadow DOM instead (so that you could only have virtual scrolling on the same subset of elements that can have shadow trees). Regardless, it would be great to get some more discussion going and generate some interest in finding a solution and moving forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions