question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LoadingController and ActionSheetController breaking each other

See original GitHub issue

Functionality I want to achieve:

  • Show Loading
  • Do some async work
  • dismiss Loading and show ActionSheet

Short description of the problem:

loading.dismiss() not working in beta 11, it was working in beta 10

loading-actionsheet

What behavior are you expecting?

  • Expected loading dismiss before ActionSheet present

Steps to reproduce: Run following code from some button click. It will show loading, then actionsheet with loading in background and you can cancel actionsheet but loading will still be in background

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

    setTimeout(()=> {
      loading.dismiss();
      let actionSheet = this.actionSheetCtrl.create({
        title: "Select me",
      });

      actionSheet.addButton({
        text: "first",
        handler: ()=> {
          console.log('first');
        }
      });
      actionSheet.addButton({
        text: 'Cancel',
        role: 'cancel',
        handler: () => {}
      });
      actionSheet.present();
    }, 2000);

Other information: Using setTimeout to mimic async function call

Which Ionic Version? Ionic 2 beta 11

Plunker that shows an example of your issue

For Ionic 2 issues - http://plnkr.co/edit/me3Uk0GKWVRhZWU0usad?p=preview Plunker uses beta 10, couldn’t modify it to use beta 11 correctly

Run ionic info from terminal/cmd prompt:

Your system information:

Cordova CLI: 6.3.0 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0-beta.32 Ionic App Lib Version: 2.0.0-beta.18 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v6.1.0 Xcode version: Xcode 7.3.1 Build version 7D1014

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jgw96commented, Aug 25, 2016

Ahh ok. So to do this instead of putting a duration on your loading component you would call loading.dismiss() after your async work was done.

0reactions
aggarwalankushcommented, Aug 25, 2016

@jgw96

Functionality I want to achieve:

Show Loading Do some async work dismiss Loading and show ActionSheet

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent Ionic 3 LoadingController from stacking
So, when a user performs some action that's blocking, I show a loadingController instance. In the mean time another asynchronous call could ...
Read more >
LoadingController - Ionic API Documentation
An overlay that can be used to indicate activity while blocking user interaction. The loading indicator appears on top of the app's content,...
Read more >
ionic/docs/core.json - UNPKG
action-sheet-controller ) from an array of `buttons`, with each button ... All other buttons will be displayed in the order they have been ......
Read more >
What to Expect When Ionic 4 Is Released - Josh Morony
We are going to look at the Ionic 4 release from three different ... Basic breaking changes that will be introduced in Ionic...
Read more >
Daily Archives: August 27, 2016 - chsakell's Blog
We these rules all users may view other user's images but only ... import {NavController, LoadingController, ActionSheetController } from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found