bug: iOS - dynamic tabs initializing (Ionic 5)
See original GitHub issueBug Report
Ionic version: [x] 5.x
Current behavior:
Inside ion-tabs
/ion-tab-bar
component, when creating ion-tab-button
s dynamically, in my case depending on params from queryParams
Observable, error occurs.
As my params are fetched after tabs initialization, there seems to be an error which isn’t properly handled on iOS.
There is a problem where if you don’t have any ion-tab
element or page with .ion-page
class on tabs initialization, error occurs in getBackButton
method inside ios.transition.js
file.
Error that breaks even ionView*
events (ionViewWillEnter
, ionViewDidEnter
, ionViewWillLeave
etc. doesn’t trigger).
Expected behavior:
To be able to create dynamic ionic tabs (ion-tab-button
s) on iOS.
Steps to reproduce:
Try creating ion-tab-button
s dynamically on iOS as described above.
Related code:
const activeTab
is null
which is causing this error:
Ionic info:
Ionic:
Ionic CLI : 6.3.0 (/usr/local/Cellar/nvm/0.35.2/versions/node/v10.16.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.0.7
@angular-devkit/build-angular : 0.901.0
@angular-devkit/schematics : 9.1.0
@angular/cli : 9.1.0
@ionic/angular-toolkit : 2.2.0
Cordova:
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.5.3, (and 34 other plugins)
Utility:
cordova-res : not installed
native-run : not installed
System:
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v10.16.0 (/usr/local/Cellar/nvm/0.35.2/versions/node/v10.16.0/bin/node)
npm : 6.9.0
OS : macOS Catalina
Xcode : Xcode 11.3.1 Build version 11C504
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top GitHub Comments
We don’t typically comment on the exact timing of releases, but I do plan on getting this into the next release. 😄
I know that the approach of dynamically generating nested tabs isn’t the best solution, but unfortunately it is what it is for now 😃 We’ll probably reimplement that once the task gets into the sprint.
This works as charm! Thanks for this fix and your effort. Do you have any idea when this fix will be released?