-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
[v2] Ion-infinite-scroll error when leaving page #5760
Comments
I updated this test to have the ion-infinite-scroll within a nav, but I'm not getting an error when going to and from the page: https://github.com/driftyco/ionic/tree/2.0/ionic/components/infinite-scroll/test/basic What do I need to update so I can replicate that error? Thanks |
Thanks, Adam for taking a look at this. Here are the steps to reproduce.
Add the following code:
then...
then... Click menu > My First List This error is thrown twice: |
I noticed something that may help zero in on the issue. If you do this, no error is thrown: Click menu > My First List However, clicking menu > My First List, then menu > Hello Ionic, the error is thrown. |
Yep confirming I have the same problem since I put the |
I can confirm that the bug still exists in Steps to reproduce:
Other information: export class Content extends Ion {
// ...
private _addListener(type: string, handler: any): Function {
if (!this.scrollElement) { return; }
// ensure we're not creating duplicates
this.scrollElement.removeEventListener(type, handler);
this.scrollElement.addEventListener(type, handler);
return () => {
// NOTE: The exception is thrown here, this.scrollElement is NULL.
// NOTE: Triggered by InfiniteScroll._setListeners(false) after Content.ngOnDestroy().
// this.scrollElement && // <- this should fix the problem, but what about the remaining handler?
this.scrollElement.removeEventListener(type, handler);
}
}
// ...
// NOTE: Executed and completes before the one of its nested component.
ngOnDestroy() {
this._scLsn && this._scLsn();
// NOTE: The scrollElement is destroyed before InfiniteScroll removes the handler.
this.scrollElement = this._scLsn = null;
}
// ...
} export class InfiniteScroll {
// ...
// NOTE: Executed later than Content.ngOnDestroy().
ngOnDestroy() {
// NOTE: This triggers the remove function returned by Content._addListener().
this._setListeners(false);
}
} Which Ionic Version? 2.x Run
|
Confirming same bug on |
Confirmed same for me when adding
|
I got the same issue |
This fix [5760](ionic-team#5760)
I got the same issue. Your system information: Cordova CLI: 6.0.0 |
Experiencing same problem. My system info: |
I'm stuck on this error. |
@warner-pinz I guess we have to wait til beta.4 |
@warner-pinz You could apply the fix directly in your project:
|
Yep, I have the same problem. |
Is this still an issue with beta4? |
@adamdbradley Hey, I tried, and the problem is solved for me, but with Waiting for confirmation :) Thanks ! |
Fixed for me. |
Great thanks! |
I updated the demo plunker environment to |
thanks problem fixed....thankyou IIgnatov... |
Just wanted to bring to your attention the following error when leaving a page that uses
ion-infinite-scroll
:EXCEPTION: TypeError: Cannot read property 'removeEventListener' of null
Reproduce by:
My system information:
Not positive, but this could also be related to this similar issue.
The text was updated successfully, but these errors were encountered: