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

ionic2 RC0 LoadingController error if dismissed after duration times out #8395

Closed
pickupman opened this issue Oct 2, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@pickupman
Copy link

pickupman commented Oct 2, 2016

Short description of the problem:

LoadingController throws exception 'EXCEPTION: Cannot read property 'remove' of null in error_handler.js:45' when you call the dismiss() method after a loading overlay has already timed out from the duration property.

What behavior are you expecting?

Calling dismiss() on a loading overlay should not throw exception if already removed from UI based on the duration property already being exceeded. What happens is the duration time expires on a loading overlay before dismiss() is called throws the exception.

Steps to reproduce:

  1. ionic start LoadingTest --v2 --ts
  2. edit home.ts with the following code
import { Component } from '@angular/core';
import { LoadingController } from 'ionic-angular';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public loadingCtrl: LoadingController) {

  let loading = this.loadingCtrl.create({
      content: 'Loading',
      duration: 2000
    });

    loading.present();

    setTimeout(() => {
      loading.dismiss();
    }, 3000);
  }

}

Other information:

Which Ionic Version? 1.x or 2.x
2.0RC0

Plunker that shows an example of your issue

Plunkr is not allowing me to import LoadingController
http://plnkr.co/edit/0n6FDdJ5CBMXsdI2ERVh

Run ionic info from terminal/cmd prompt: (paste output below)
Your system information:

You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.3.1

Gulp version: CLI version 3.9.0
Gulp local:
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v5.7.0

@manucorporat manucorporat self-assigned this Oct 2, 2016
@manucorporat manucorporat added this to the 2.0.0-rc.1 milestone Oct 2, 2016
@manucorporat manucorporat added the v2 label Oct 2, 2016
@manucorporat
Copy link
Contributor

fixed!

@zakton5
Copy link
Contributor

zakton5 commented Oct 3, 2016

Just a note, the opposite of the original issue is also true. Dismissing a loading overlay BEFORE the duration ends throws an error when the duration ends. For example: If I present a loading overlay with duration: 5000 and then dismiss it after 3 seconds, the same error will be thrown 2 seconds later, when the 5000ms ends.

@manucorporat Just a suggestion: It might be better to also clear the timeout immediately after the overlay is dismissed.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 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