fix(tabs): do not emit tab change if selectedTab undefined

This commit is contained in:
Adam Bradley
2019-07-02 15:04:46 -05:00
parent dfa2b13c3a
commit 03c834c647

View File

@@ -34,9 +34,11 @@ export class TabBar implements ComponentInterface {
@Prop() selectedTab?: string;
@Watch('selectedTab')
selectedTabChanged() {
this.ionTabBarChanged.emit({
tab: this.selectedTab
});
if (this.selectedTab !== undefined) {
this.ionTabBarChanged.emit({
tab: this.selectedTab
});
}
}
/**