Skip to content
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

bug: Cannot read property 'removeEventListener' of null #5989

Closed
cperez87 opened this issue Mar 30, 2016 · 1 comment
Closed

bug: Cannot read property 'removeEventListener' of null #5989

cperez87 opened this issue Mar 30, 2016 · 1 comment

Comments

@cperez87
Copy link

Short description of the problem:

When I do this.viewCtrl.dismiss() on a Modal page, im getting * Cannot read property 'removeEventListener' of null*.
That is, when I have an ion-infinite-scroll on the page

I have tried using this.nav.pop() and this.nav.popToRoot() and still get the same issue.
The only things that has worked is removing the infinite scroll.

What behavior are you expecting?

Expecting Modal page to close without errors.

Tested with

ionic serve --lab

Sample Code

import {Page, ViewController} from 'ionic-angular';

@Page({
    template: `
    <ion-navbar>
        <ion-buttons start>
            <button (click)="closeModal()">
                Close
            </button>
        </ion-buttons>
        <ion-title>Sample</ion-title>
    </ion-navbar>

    <ion-content class="has-header">
        <ion-infinite-scroll (infinite)="loadMoreItems($event)" >
            <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="Loading items..."></ion-infinite-scroll-content>
        </ion-infinite-scroll>
    </ion-content>
    `
})
export class SamplePage {
    constructor(private viewCtrl: ViewController) {

    }

    closeModal() {
        let resultData = {a: 1, b: 2};
        this.viewCtrl.dismiss(resultData);
    }

    loadMoreItems(infiniteScroll) {
        //Some code here
    }
}

Call from a page with something like

let modal = Modal.create(SamplePage);
modal.onDismiss((data) => { 
//Do something here
});
this.nav.present(modal)

Ionic Version: 2.x

Cordova CLI: 6.1.0 (cordova-lib@undefined)
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.23
Ionic App Lib Version: 2.0.0-beta.13
Node Version: v5.9.1

@cperez87
Copy link
Author

#5760
Closing my post because it was already brought up in another post. Merge if needed.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants