ionic-team / ionic-team/ionic-framework

Lifecycle events called in wrong order

Ouverte
#17,373 4 commentaires 5 réactions 0 personnes assignées Voir sur GitHub
package: angular type: bug
Langage dominant
TypeScript
Étoiles
52.7k
Forks
13.3k
Merge moyen
1 j 15 h
PR mergées (30 j)
51

Description

# Bug Report

**Ionic version:**
[x] **4.0.0**

**Current behavior:**
When changing the root page the lifecycle events of the previous and next page seem to fire out of order. So, lets say page A is currently displayed. Navigating to page B fires the lifecycle events in the following order:
1. Page B: ngOnInit
2. Page B: ionViewWillEnter
3. Page B: ionViewDidEnter
4. Page A: ngOnDestroy

(ionViewWillLeave and ionViewDidLeave do not fire at all)

**Expected behavior:**
I would expect that page A fires ngOnDestroy or ionViewWillLeave or ionViewDidLeave before page B's 'enter' events

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by reproducing the reported navigation from page A to page B in Ionic 4.0.0 and log ngOnInit, ionViewWillEnter, ionViewDidEnter, ngOnDestroy, ionViewWillLeave, and ionViewDidLeave. Trace the lifecycle handling involved in root-page changes; done means the previous page's leave or destroy lifecycle occurs before the next page's enter events, with the expected callbacks firing.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend, mobile
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.