From 03c834c6472519552d6005c42dcbfe6f63784dc4 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 2 Jul 2019 15:04:46 -0500 Subject: [PATCH] fix(tabs): do not emit tab change if selectedTab undefined --- core/src/components/tab-bar/tab-bar.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/components/tab-bar/tab-bar.tsx b/core/src/components/tab-bar/tab-bar.tsx index 75edacc204..2cb82d7da5 100644 --- a/core/src/components/tab-bar/tab-bar.tsx +++ b/core/src/components/tab-bar/tab-bar.tsx @@ -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 + }); + } } /**