Skip to content
Permalink
Browse files

fix(tabs): initialize select in the willLoad before the select call i…

…s made (#18300)

#17957
  • Loading branch information...
brandyscarney committed May 20, 2019
1 parent fa87e35 commit da3864747803c8f6b7aed4a57e82a7874a7db658
Showing with 2 additions and 4 deletions.
  1. +2 −4 core/src/components/tabs/tabs.tsx
@@ -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]);
}

0 comments on commit da38647

Please sign in to comment.
You can’t perform that action at this time.