-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
fix(VInfiniteScroll): keep triggering loading logic until isInterseting becomes false #17475
Conversation
…ng becomes false fixes #17358
I don't quite understand this bug. Is the intent for the loading animation to show always? |
It should keep triggering load emit until VInfiniteScrollIntersect disappears |
I'm not completely on board with this even being a bug. If I have an infinite scroller that doesn't have enough items to fill the viewport, I wouldn't want it to constantly run load with the circular progress visible. If we were to do this, I would expect it to say "No more items" or something similar after a duration of time where nothing is being loaded. |
The issue occurs when a user has a large number of total items but is using pagination, for example, loading 3 items per load.
|
There are more items, they are just not being loaded. Maybe this illustrates the issue better: If i have small item with big screens i am gonna have to load 200+ items minimum per call to make sure the infinite scroller doesn't get stuck. |
I would still want a way to fast fail out of the loader perpetually being there. |
I've been hit by this issue too. I agree that the
Forcing developers to load enough content to fill the scrollable area to prevent the issue is not really workable. I'm no UX expert but I think this is actually a better user experience too. If the content area is large enough to show it and there is more data available, it makes sense to continue to load it. Loading in smaller chunks allows users to act on 'earlier' loaded items if desired but still see that more data is coming. The smaller chunk size can also help to lower demands on the back end and bandwidth. Incidentally, I've also just opened #17583 that currently allows a workaround for this issue. Don't specify the margin explicitly, resize the viewport and the infinite scroll can be triggered to load more content avoiding this issue. But if that issue is fixed before this, the workaround stops working. |
For this, I think it's really just the case where badly behaved developers return a status of To cover this case you could potentially have some functionality to determine whether the number of child elements has changed each cycle and if multiple cycles occur with no change then abort the load loop. But that seems like extra complexity to cope with incorrect use of the API. |
This is a good point. @yuwu9145 can we add an example under the guide explaining this? |
I don't think it's our responsibility of coping with incorrect use of the API from user's land (return a status of However, when user does use API correctly to properly return Playground has been updated to include empty/error examples |
fixes #17358
Description
Markup: