-
Notifications
You must be signed in to change notification settings - Fork 373
Keep loading elements until parent overflows #21
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
I guess the logic can be optimized further. If the |
Glad you like it :) You're right, this is an interesting problem, thanks! You mean it should to check the distance immediately after received |
Yes, that's exactly right! If the distance is above the bottom after the load event, more should be fetched. Otherwise, should wait for scroll event to bring it close to the bottom. |
That may resolve my own issue which was to load content on page load if the page was already too long to have the proper distance to trigger loading. Take the case of a right column with many filters that could be quite long, when you load the page nothing is loaded as the distance to the bottom is not met. I dealt with it this way in my Vue instance, but it is a temporary fix:
@dragantl proposal would solve this. Sort of a The idea is to separate the auto loading dependent on distance (which would be triggered only if One last thing, it would be great to have an option to manually call for more (button load more results) in place of the distance parameter, if it better suits our needs. Almost forgot: Really great and useful component, simple and easy to use 👍 |
I have modified my local library with the following changes and it seems to work fine:
In my code, I then used @PeachScript Your thoughts? Can you look at and apply the changes? Should I make the PR? PS: This added logic can be extracted to a separate function and called in |
@JeanLucEsser Thanks for your solution and glad you like it! You mean this component need to add a property to indicate whether or not to check the distance immediately, is that right? |
@dragantl Thanks for your work! But I made a mistake before, I trying to let this component support At the beginning I should create a new branch to program, now I will fix the |
@PeachScript Sure, just let me know when and I'll make a PR. |
@dragantl Maybe I need more time to support the |
Ok, I'll make PR today/tomorrow |
Got to it just now. |
I think this can be closed now that #23 has been merged. Thanks! |
Thanks a lot for the lib. Its really easy to integrate. I ran into an issue only on a small detail. My page uses a flexible grid whose items shrink and grow as the window resizes. As such, it may be the same that on various screens, the initial load may not result in enough items to overflow the parent. If that happens, user has no way of loading more as there is no scroll. Is it possible for the lib to call on-infinite until the list container overflows the parent? There is another potential issue with resizing of the screen that will not be picked up to have more items loaded.
Do you have any suggestions?
The text was updated successfully, but these errors were encountered: