-
Notifications
You must be signed in to change notification settings - Fork 722
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
Infinite scroll watchers triggers when loaded page is smaller then window size and eats CPU #281
Comments
Having this exact same problem. In my case, I have multiple small "widgets" on a page each with its own infinite-scroll. |
@Skomantas and @RELnemtzov ive faced same issue even on 1.2.1 the workaround i found is <div infinite-scroll="ctrl.yourMethod()" infinite-scroll-distance="ctrl.simpleVariable">
//in controller:
var self = this; //this or use $scope
self.simpleVariable = -1 ;
//use $timeout to make a 100 millis timeout and switch distance to 1
$timeout(function(){
self.simpleVariable = 1;
}, 100 ) ; This should help , i think there is a bad calculation of the heights and remainings , while distance is used for those calculations we can cheat a bit. @Skomantas and @RELnemtzov please reply if it helped |
Also eventually will run out of memory and crash the chrome tab... |
This is a huge bug. Our team spent many days trying to source of this. We've pegged our app to the previous version as suggested to fix this. Please fix! |
Guys please confirm if my fix did the trick ? |
@rubenCodeforges, the fix sometimes works for me. However, based on timing it may still cause issues. I had to fork the library and add the count=1 argument back on the initial $interval call. This causes me issues since my infinitely scrolling data may not be infinitely scrolling. Sometimes my data sets are very large and other times there may only be 1 or 2 records. In this minimal case the CPU goes crazy forever since "shouldScroll" keeps being true. I guess that may not have been the intent of this library which is why I didn't submit a pull request. |
@neilvana if it sometimes doesnt work , try to increase timeout $timeout(function(){
self.simpleVariable = 1;
}, 500 ) ; |
@eugeneware we had same issue , hope it will be fixed |
I just stumbled upon this problem too: when profiling the page, I saw some code executed every 10ms that was digesting the page, which seemed insane. When looking down at the code, I saw it was coming from the So short story: if you use the version on master, you should be fine, if not, you're screwed. Also, why in hell use a |
@mebibou i hope devs will spot this issue |
For me this causes a huge memory leak in my browser as well while switching pages that use What I find surprising is that this issue seems to have been popping up only recently, while the (it might very well be possible that I didn't catch the memory leak before and this is just strange coincidence, but I wanted to verify). |
is this issue fixed with |
@dohomi should be, try it out. |
ok I'll do it soon |
@dohomi yes it is included in the release |
@mebibou what is included in which release? |
duplicate of #235 |
Infinite scroll watchers do not cancel loop (triggering) when page size is smaller then window size, even if page is loaded. downgrade to "ngInfiniteScroll": "1.2.1", from "ngInfiniteScroll":"1.2.2" solves the problem.
The text was updated successfully, but these errors were encountered: