Ionic 2 RC1: Loading dismissOnPageChange & ionViewDidLoad
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:
- In ionViewDidLoad() method
- Create Loading via:
this.loginLoading = this.loadingController.create({ dismissOnPageChange: true }); - 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
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 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)
Same problem here. I tried with ionViewDidEnter and the loading is dismissed on its own. Any tip for this?
@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
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!
Issue moved to: https://github.com/ionic-team/ionic-v3/issues/136