-
-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite scroll in *both* directions (i.e. down and up) #317
Comments
There's no way to scroll past an offset of 0, unfortunately. So the only way you could implement something like that would be to use a hack similar to what you describe. Bidirectional infinite scrolling doesn't sound like a common enough use case (in my opinion) to be something I'd want to invest a ton of effort into to be honest. |
No worries, just thought I'd post in case there was some value in it. Will close. Maybe a newsfeed that loads new stories at the top would be another example? |
Hi @bvaughn |
@AliNazariii +1 @bvaughn This feature would be very helpful and great extension for this awesome library (which solving big pain already). For example "vertical chat messages list" - Initially It should be rendered with scrolled to the latest item, and user should scroll backwards through the chat history. I'm currently trying to find some hack for backwards vertical scrolling for exact case in my app. |
Hi @osadchiynikita, Please inform me if you found a solution to use the virtualized list in a messaging app. |
I’m trying to do POC now using another lib - https://virtuoso.dev/ |
@osadchiynikita yeah, I tried it, too. But it had some problems in a bidirectional scroll. On backward vertical scrolling, it goes up and then it comes where I was before the scroll. |
@AliNazariii Yes, I also have issue with scrollbar position after load more 😕 |
I had the same issue with Virtuoso because it seems to need to update two props to scroll when using backwards vertical scrolling. What did you guys end up using for virtual scroll?? |
@osadchiynikita @AliNazariii I'm in need of bi-directional infinite scroll component as well. Did either of y'all land on a solution or able to hack together something with an existing library? |
@osadchiynikita @AliNazariii @birdwell @rossknudsen I have something similar implemented, only I use it on the horizontal axis. Here's the excerpt that handles this. I also don't just add new items, but take items from one end add more on the other side. I'll be happy to answer any questions and also would love to hear any ideas for optimizing this mess. One more thing, this is just the excerpt that handles the removing/adding items and repositioning the scroll, some variables might be hanging or missing.
|
Hey all,
I had to implement a time picker for work that was modeled off of an existing UWP/WPF component. The picker could scroll infinitely (or at least appeared to) in either direction, allowing the user to scroll to find the time they wanted in either direction.
I forked an existing codesandbox example to prove that react-window could do the job - which it did. But one thing I couldn't achieve was the ability to scroll infinitely in the upward direction. I'm guessing that the list index is bounded to zero and cannot be negative, so I worked around it by setting the starting point far into the "future" thereby setting the index to a high number. See the line:
const numberOfDaysToScrollTo = 1000;
Just wondering if there is another way to solve this, or whether its a feature that you'd consider adding - it may have been proposed before.
But anyway, thanks for the awesome library.
The text was updated successfully, but these errors were encountered: