-
Notifications
You must be signed in to change notification settings - Fork 373
Force initial loading when not at distance #36
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
Comments
Is this the same issue #21 ? |
Kind of, it's what I meant in my comment of that issue. But what is missing is the ability to auto fire the first load even if the distance from bottom has not been reached. I think that it has not been implemented in issue #21. Or did I miss a property? |
I guess you need a spinner as the loading animation, is that right? If so you're right, this component does not has this feature. But I cannot imagine the application scenario you said, is it out of the category of infinite scroll? |
No that's not what I need. I need a function or a way to manually start loading the first batch of items. Currently the first batch of items is triggered in the same way as when we scroll: distance from bottom is less than a given value. In a desktop application, there may be situations where that condition cannot be met on page load. Take your hacker news example: Translate it to a desktop app. Add an aside column that has a 5000px height. Now your items won't load in your main column unless you scroll to the bottom of the page to trigger it. Other example: imagine you do not want to load your items unless you ask for it. How would you 1/ prevent loading on page load and 2/ trigger loading with a "load results" button? I'm going to try and take some time to code an example so you understand my issue. |
I have already understood, thanks a lot! There has two columns in the page, and you want to load more data for the left page, but due to the right page is too high lead to the distance lager than the edge value, but the component cannot resolve it, I wrote a demo on JSFiddle, is that your meaning? |
Yes that's it. I tried to add:
But there are two issues. First, when called this way, the function does not trigger the loading animation. Second, if my right column is empty (not 5000px), the function gets called twice, once on mounted, once by default. Plus it doesn't answer the case where I need to manage loading items manually. What I think could make sense is the following:
What do you think? |
Okay, I need time to think about it. |
Sure do not hesitate to share your reflexions! |
Hi @JeanLucEsser, sorry to late, I have been improved the way to calculate distance and released |
@JeanLucEsser is your problem solved? |
@PeachScript yes after a few tests, the problem appears to be fixed, thank you very much. I still think some options to manually trigger loading should be nice but the main issue is now fixed so that's a good thing. ;) |
That's good, thanks for your idea, and I also believe my own ideas like you. :P Best regards. |
Uh oh!
There was an error while loading. Please reload this page.
I have a page such as the distance from the bottom is too high by default to trigger the infinite scrolling. Is there a way to force initial loading of elements independent from the distance?
Imagine the following layout where column 2 can be very tall and column 1 has the scrolling list:
The only way I see to load the list is to go to the bottom of the page (the scroll parent). It will then fill the page if it is very tall, no problem. The issue is the first (initial) loading.
The solution would be the option to fill the page on load without relying on the distance parameter. Something akin to "Always fill the page on load, whatever the distance".
Another (better?) solution would be to rely on the viewport. If the viewport is empty, fill it. Not sure this is possible though.
Am I missing something obvious here to trigger onInfinite() on page load? Firing onInfinite() on Vue instantiation
mounted
event won't work well as the spinner won't show and in some cases (short page) onInfinite() will be called twice.The text was updated successfully, but these errors were encountered: