-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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-scrolling example not working using the scrollbar #3894
Comments
I just tried the example using Remix 1.6.7, and everything is working as expected: In the network tab, I can see the XHRs being fired, and the response does contain Can you share more details about your setup ? (node version, browser, etc) Thanks ! |
Thanks for such a short reply. I cannot run this example on code sandbox - not sure what is wrong, but I'm getting blank screen. I downloaded repo and run it.
Note that you can't use you're mouse wheel or touchpad. To repro this you need to drag scroll bar with mouse. |
I also encountered a problem with codesandbox, and ran the project locally using I was using the touchpad, but I do see the problem now while using the scrollbar ! |
I tested your change, and it seems to do the trick, although the scrollbar gets a little jumpy. |
Yeah it does. Although in my scenario I had to some more tweaks to make it work. I agree that scrollbar is jumpy, but if there would be a wish to have scrollbar mimic fully loaded data set it would require refactoring of how items are loaded into array (currently the problem is that due to so many state changes some of them seems to be skipped, hence indexes mismatch). Maybe, before making code changes it would be a good idea to discuss and have a clear goal for this example. I can help out with this naturally :) In case we are okay with "classic" infinite scroll (where list extends height as more items are loaded) I can provide some PR to fix this example. |
Summoning @kentcdodds 🪄 |
Can we compare what you're experiencing with other infinite scroll examples like Twitter? Do you experience the jumpiness there? It's it just an issue with infinite scroll in general? |
I don't have a Twitter, but e.g. 9gag is using the same pattern: Although it seems like a cool thing to display scrollbar as if all items are already loaded it is causing many technical obstacles. And when I think about it more UX is not ideal as well. Let's say list is 30k elements. With such number of items scroll is not precise anyway, so I think it's not that useful. |
I'd like to see what code changes actually look like in a PR. I think I'd probably merge it 👍 |
@kentcdodds |
Merged. Thanks! |
What version of Remix are you using?
1.6.4
Steps to Reproduce
Open
examples/infinte-scrolling
and selectpage/simple
.Expected Behavior
When I scroll by grabbing scroll bar to bottom I should see all the elements loaded.
Actual Behavior
Elements displays as
Nothing to see here...
I think you might want to change:
to
Otherwise this is generating many problems like calling issues when scrolling fast or throwing warnings:
The text was updated successfully, but these errors were encountered: