-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
this.$().offset().top undefined at times #137
Comments
can you link to a repo where we can see the error reproduced? |
exact error: TypeError: this.$(...) is undefined import Ember from 'ember'; export default Ember.Route.extend(InfinityRoute, { in the template I am just doing Now I have various test cases that make use of this page that has the infinite scroll. The test cases are mostly related to server side filters.. I runs normally at times but it also fails quite often. |
I don't see anything wrong with that code. It might be that the issue is not related to ember-infinity. |
Issue is related to ember-infinity code... Each time it errors out in the same line I pointed to. It is trying to fetch the page offset top and failing to find that when test cases run. It works fine when I just play manually with this page by selecting various sort orders and filters and infinity loader does the job. When I run test cases which are usually a lot faster than manual clicks, it bails out at times!!! could this be related to an open issue #100 ??? |
HI @venkz ! This isn't related to #100 Seeing as you're only getting this error in testing, I'm pretty confident that what is happening is:
Can you please create a file called import InfinityLoader from 'ember-infinity/components/infinity-loader';
export default InfintyLoader.extend({
_loadMoreIfNeeded() {
if (this.isDestroyed) { return; }
return this._super(...arguments);
}
}); And let me know if that fixes the bug? Thankyou! |
Hey @hhff This is exactly where I was getting to. I shall try it out and let you know. |
@hhff , I tried creating a component on my own extending from your's and did run my test suite for 5 times before confirming this. IT WORKS 👍 I submitted a pull request making this fix thinking it would be easier for you guys to integrate. Thanks for all the help. Appreciate your work.. |
gnarly!! thanks @venkz |
I was not using the destroyOnInfinity flag but I still run into this issue when I run Ember test suite on pages that have infinity scroll. It is not reproducible consistently but I see this quite often.
Could you give me any clue as to why this occurs and what is happening here...
I updated to 0.2.1 V hoping it will fix the issue but no luck!
path: components/infinity-loader.js : 46
The text was updated successfully, but these errors were encountered: