Bi-direction infinite scroll table with maxPages - uncontrolled scroll
Goal I would like to build a table with bi-directional infinite scroll where only a few pages are stored in the cache at a time. So as a user scrolls both up or down, more rows are fetched when the user scrolls to the top or bottom and the newly fetched rows replace old rows in the cache.
Problem When I use
Reprex I have a code sandbox that illustrates the problem. Commenting/uncommenting
I really appreciate any help or guidance anyone can provide. Thanks!
Problem When I use
maxPages to control the cache size, I encounter an issue with scrolling. On scrolling up/down, sometimes the table continues to scroll well beyond how much I actually scrolled on my mouse wheel. It's as though the browser takes over and decides it's going to keep on scrolling until it hits the end of the table. If I don't set a maxPages argument though, the scroll behavior is as I expect. That is, the table scrolls based on how far I scroll, and doesn't get caught in a continuous scroll.Reprex I have a code sandbox that illustrates the problem. Commenting/uncommenting
maxPages (no other changes) results in the two different scroll behaviors.I really appreciate any help or guidance anyone can provide. Thanks!