Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions angular/src/directives/navigation/ion-tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ export class IonTabs {
* to the default tabRootUrl
*/
@HostListener('ionTabButtonClick', ['$event'])
select(ev: CustomEvent) {
const tab = ev.detail.tab;
select(tabOrEvent: string | CustomEvent) {
const isTabString = typeof tabOrEvent === 'string';
const tab = (isTabString) ? tabOrEvent : (tabOrEvent as CustomEvent).detail.tab;
const alreadySelected = this.outlet.getActiveStackId() === tab;
const tabRootUrl = `${this.outlet.tabsPrefix}/${tab}`;

Expand All @@ -98,7 +99,9 @@ export class IonTabs {
* will respond to this event too, causing
* the app to get directed to the wrong place.
*/
ev.stopPropagation();
if (!isTabString) {
(tabOrEvent as CustomEvent).stopPropagation();
}

if (alreadySelected) {
const activeStackId = this.outlet.getActiveStackId();
Expand Down