Closed Stephane84 closed 5 years ago
This is probably the same as my issue (#308), since my super tabs also had only one tab when I tested this.
Hi - I've submitted a fix for this in PR #323 - if you could show support for that PR we can get it fixed properly
Hello, here is the bug :
In a new ionic3 app, use supertabs in a page (Page1). In Page1, supertabs must have only one tab (Tab1). In Tab1, put a button to navigate to another page (Page 2) using this :
this.app.getRootNavs()[0].push("Page2Page");
Page 2 use supertabs with 2 tabs (Tab2 and Tab3)When we ionic serve the app, we first arrived in Page1, so, the first supertabs of the app who is loaded has only one tab Clic to the button to go to Page2 where there is another supertabs We obtain the js error :
Cannot read property 'getActiveChildNavs' of undefined
In my project, i have some pages using supertabs with *ngIf conditions on tabs, and sometimes, i have only one tab to display. If the fist supertabs displayed in the app has only 1 tab in supertabs, the others pages using supertabs have the js error.
To make sure, change the rootPage to arrived in Page2 instead of Page1 when ionic serve, and see that it works if you go to Page1 from Page2. Because, the first supertab loaded as more than 1 tab.
I have a temporary hack :
Display in the same page before the one tab supertabs (or in a previous page you visited before) a superTabs in style display:none, with at less 2 tabs, (linked to empty page)
ex :
full js error :
Versions info : @ionic/cli-utils : 1.19.2 ionic (Ionic CLI) : 3.20.0 @ionic/app-scripts : 3.1.9 Cordova Platforms : android 6.2.3 Ionic Framework : ionic-angular 3.9.2
ionic2-super-tabs : 4.2.2