fix(tabs): angular, fire willChange event before selected tab changes (#24910)

Co-authored-by: Sean Perkins <sean@ionic.io>
This commit is contained in:
Amanda Smith
2022-03-09 14:34:51 -06:00
committed by GitHub
parent 3e7dfd5f73
commit d5efa11331
5 changed files with 80 additions and 9 deletions

View File

@ -57,10 +57,10 @@ export class IonTabs {
onPageSelected(detail: StackEvent): void {
const stackId = detail.enteringView.stackId;
if (detail.tabSwitch && stackId !== undefined) {
this.ionTabsWillChange.emit({ tab: stackId });
if (this.tabBar) {
this.tabBar.selectedTab = stackId;
}
this.ionTabsWillChange.emit({ tab: stackId });
this.ionTabsDidChange.emit({ tab: stackId });
}
}