question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Virtual scroll infinite loop in both direction

See original GitHub issue

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

Infinite scroll in both direction

What is the current behavior?

Currently the infinite scroll is not possible in both direction

What is the use-case or motivation for changing an existing behavior?

I am using horizontal virtual scroll, I need to provide infinite scroll in both direction and keep the current index always in center of the view port

Assume the array is

[0][1][2][3][4][5][6][7][8][9]

                       currIndex
                          |       
  [6][7]       |   [8][9][0][1][2]   |   [3][4][5]
Not rendered   |      Rendered       |  Not rendered

Let’s say user go to viewport.scrollToIndex(2)

                       currIndex
                          |       
  [8][9]       |   [0][1][2][3][4]   |   [5][6][7]
Not rendered   |      Rendered       |  Not rendered

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 7.0.1 Material: 7.0.2

Is there anything else we should know?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mmalerbacommented, Nov 12, 2018

here’s an example that adds new copies of the data when you get near the end of the list: https://stackblitz.com/edit/angular-qpsjxm?file=app/cdk-virtual-scroll-data-source-example.ts

0reactions
angular-automatic-lock-bot[bot]commented, Sep 10, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to allow infinite scrolling in the both directions with md ...
I've implemented an infinite horizontal scroll using md-virtual-repeat. It fetches 25 records each time when needed when I scroll to the right.
Read more >
Infinite Virtual Scroll with the Angular CDK - Fireship
It provides tools for looping over a lists that only render elements when they are visible in the viewport, preventing lag an janky-ness...
Read more >
Infinite Scrolling vs Virtual Scrolling in Angular
In a virtual scrolling strategy, the total number of elements remains the same as the user scrolls, just that the current ones are...
Read more >
Angular 7 Virtual Scroll - To Infinity and Beyond - YouTube
Learn how to use the new Virtual Scroll behavior in Angular CDK v7 to build a list that is infinite, animated, and realtime...
Read more >
Create an Infinite Scrolling list with Angular CDK ... - YouTube
... #CDKIn this video, I walk you through building a blazing fast infinite scrolling list using the Angular CDK Virtual Scroll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found