mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(tabs): initialize select in the willLoad before the select call is made (#18300)
#17957
This commit is contained in:
@ -49,14 +49,11 @@ export class Tabs implements NavOutlet {
|
||||
this.useRouter = !!this.doc.querySelector('ion-router') && !this.el.closest('[no-router]');
|
||||
}
|
||||
this.tabs = Array.from(this.el.querySelectorAll('ion-tab'));
|
||||
await this.initSelect();
|
||||
this.ionNavWillLoad.emit();
|
||||
this.componentWillUpdate();
|
||||
}
|
||||
|
||||
componentDidLoad() {
|
||||
this.initSelect();
|
||||
}
|
||||
|
||||
componentDidUnload() {
|
||||
this.tabs.length = 0;
|
||||
this.selectedTab = this.leavingTab = undefined;
|
||||
@ -156,6 +153,7 @@ export class Tabs implements NavOutlet {
|
||||
}
|
||||
// wait for all tabs to be ready
|
||||
await Promise.all(this.tabs.map(tab => tab.componentOnReady()));
|
||||
|
||||
await this.select(this.tabs[0]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user