ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Ionic 2 RC1: Loading dismissOnPageChange & ionViewDidLoad

Open MankinPT opened this issue 10 years ago • 6 comments

Short description of the problem:

Creating a Loading via LoadingController with dismissOnPageChange: true on ionViewDidLoad(). The Loading will be dismissed on its own.

What behavior are you expecting?

I expect that when I create a Loading on ionViewDidLoad(), it will continue open until I explicitly dismiss it or there is a page change (ionViewDidLoad should not trigger a page change).

Steps to reproduce:

  1. In ionViewDidLoad() method
  2. Create Loading via: this.loginLoading = this.loadingController.create({ dismissOnPageChange: true });
  3. Loading closes on its own (if I remove dismissOnPageChange it stays opened).

`

Which Ionic Version? 2 RC.1

Run ionic info from terminal/cmd prompt:

Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.1 Gulp local: Ionic Framework Version: 2.0.0-rc.1 Ionic CLI Version: 2.1.1 Ionic App Lib Version: 2.1.1 Ionic App Scripts Version: 0.0.36 OS: Windows 8.1 Node Version: v4.4.7

MankinPT avatar Oct 25 '16 16:10 MankinPT

Hello, thanks for opening an issue with us! Creating and opening components should actually be done in ionViewDidEnter and not ionViewDidLoad. The dom is not guaranteed to be ready in ionViewDidLoad and events are not guaranteed to be ready.

jgw96 avatar Oct 27 '16 18:10 jgw96

@jgw96 Sorry for the late response.

Tried it with ionViewDidEnter, exactly same behavior than ionViewDidLoad.... the loading modal still closes without a dismiss command (when dismissOnPageChange: true)

MankinPT avatar Oct 31 '16 11:10 MankinPT

Same problem here. I tried with ionViewDidEnter and the loading is dismissed on its own. Any tip for this?

pabloim1 avatar Jun 14 '17 15:06 pabloim1

@jgw96 I'm loading data from the server in the ionViewDidLoad(), i can't just put loading data from server within ionViewDidEnter because it will make request each time the view enters.

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.7.1

System:

Node : v6.10.3
npm  : 4.1.1
OS   : Windows 8.1

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

shadoWalker89 avatar Jan 16 '18 14:01 shadoWalker89

This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!

Thank you for using Ionic!

ionitron-bot[bot] avatar Nov 28 '18 21:11 ionitron-bot[bot]

Issue moved to: https://github.com/ionic-team/ionic-v3/issues/136

ionitron-bot[bot] avatar Nov 28 '18 21:11 ionitron-bot[bot]