Closed carlosalvidrez closed 6 years ago
There's no out of the box support, but it can be implemented.
To do it, do not add in the template the defaultBootstrapPaginator and add an onScroll event to check when you're near the end of the page to increase pagesize: Template.instance().pagination.perPage(Template.instance().pagination.perPage() + 10);
Got it to work thanks. Further question... my template resizes every time the page count gets incremented, taking the user back to the top of the page. Do you know if I am doing something wrong, or a way to avoid this... I'd like the user to stay in the last "div"/document loaded, and just let the page grow down.
Thanks again.
Are you by chance showing a loading when the pagination is not ready? That would force the browser to resize the template height and when the documents are loaded it would have the scroll on top of the page.
There's also the option to save the scroll position when changing the perPage
and restoring it after they were loaded, but that will definitely be noticed as a scroll jump.
Try to debug and check if the template is rendered with a lower height which would reset the scroll just before loading new documents.
Thanks for the guidance. Haven't solved it yet, but I'll share a solution when I find it.
Cheers
Does this package support infinite scrolling? Thanks!