Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabs): select the correct tab on load with the select method #18300

Merged
merged 2 commits into from May 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions core/src/components/tabs/tabs.tsx
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
}

Expand Down