sroze / ngInfiniteScroll

Infinite Scrolling for AngularJS
http://sroze.github.com/ngInfiniteScroll/
MIT License
2.89k stars 723 forks source link

Infinite-scroll function is not called when page is resized #367

Open bradlys opened 7 years ago

bradlys commented 7 years ago

I have a column inside my page that uses this ngInfiniteScroll. It's a people picker (you click a person and it filters on that person for results in another column). If the column containing the results is bigger than the results list because you have a very large window or someone resizes the window to where there is no longer a scrollbar, the ngInfiniteScroll won't call my 'show more people' function. Presumably this is because it listens on scroll events but there's no scroll even to happen when the element expands to where it no longer has a scrollbar.

Is there a way around this for both scenarios?

mgm09a commented 6 years ago

@bradlys Have you tried using the "infinite-scroll-listen-for-event" option and setting it up to listen for a window resize event?

infinite-scroll-listen-for-event (optional) - {string} - The name of an event that, when received, will cause the scroll position check to be re-run. This is useful if you need to manually trigger the scroll handler, for instance if your items have been filtered or modified without altering the collection.

Read more about parameters.