Ionic-framework: Selecting a Tab in Tabs do not trigger viewWillEnter lifecycle event

Created on 16 May 2017  路  16Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
[ ] 1.x
[ ] 2.x
[x] 3.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

Clicking tab buttons in the tabs component does not trigger App#viewWillEnter and other lifecycle events, except the first time the page is being loaded.

Expected behavior:

Every time selected tab changes in tabs component, lifecycle events get triggered on each tab's view.

Steps to reproduce:

http://plnkr.co/edit/sJFO6E9cRUXeKWSXb1LZ?p=preview

Related code:

n/a

Other information:

Probably related: #9787.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

global packages:

    @ionic/cli-utils : 1.0.0
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.0.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.0.0
    @ionic/cli-plugin-ionic-angular : 1.0.0
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v6.10.3
    OS         : OS X El Capitan
    Xcode      : Xcode 8.2.1 Build version 8C1002 
    ios-deploy : 1.9.1 
    ios-sim    : 5.0.13 

Most helpful comment

That is a very important statement @Creawebs. I really wish this would be announced properly on the Ionic Website or blog. You are effectively ending any and all support for Ionic 3 (and previous), even before Ionic 4 is out. This is a very important decision that really ought to be communicated honestly and openly with everyone in a proper manner. Why even bother filing or commenting on v3 tickets then?

All 16 comments

@jgw96 what do you think about solution which I proposed in #11752 ? Can it be integrated?

@stalniy , it looks like the right direction to me. Could you open a PR for it and we can discuss it there with our resident navController expert @manucorporat ?

@jgw96 do you have this PR opened somewhere?

The same tabs problem occurring to me, i have also opened this issue #11786. Annoying problem

What's the status on this? The current implementation is pretty useless.

Some news on this issue??

Not actually closed, accidentally moved this issue instead of another.

This has been fixed and will be in the next release.

Could you please specify what "the next release means"? :)
I mean something palpable, a version number or date.

@mlynch The event ionViewCanLeave is indeed firing but the bug still remains where it actually does let you change the tab. It hasnt been fixed on the latest release.

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

global packages:

    cordova (Cordova CLI) : not installed

local packages:

    @ionic/app-scripts : 3.1.6
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

@kensodemann Any updates on this issue?

@Creawebs - we are not planning on having any more v3 releases of Ionic. You will need to retest this in v4 when it is released and then create a new issue if it is still a problem. The first BETA for v4 should be soon (within a few weeks).

That is a very important statement @Creawebs. I really wish this would be announced properly on the Ionic Website or blog. You are effectively ending any and all support for Ionic 3 (and previous), even before Ionic 4 is out. This is a very important decision that really ought to be communicated honestly and openly with everyone in a proper manner. Why even bother filing or commenting on v3 tickets then?

@loban ionic 4 + Angular has minor breaking changes (by minor, I mean changes in markup only). So, migration should not be a big deal

@stalniy I am not sure if thats the case, as the router is in my opinion quite a big change.

@kensodemann Ionic has been my go to project for the past 3 years or so and I have always bet on ionic and pushed it forward in my teams, but somewhat ending support for v3 like this really makes me lose faith in the framework.

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings