File tree Expand file tree Collapse file tree
angular/src/directives/navigation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,10 +86,20 @@ export class IonTabs {
8686 * b. If the last route view doesn't exist, then navigate
8787 * to the default tabRootUrl
8888 */
89- @HostListener ( 'ionTabButtonClick' , [ '$event.detail.tab' ] )
90- select ( tab : string ) {
89+ @HostListener ( 'ionTabButtonClick' , [ '$event' ] )
90+ select ( ev : CustomEvent ) {
91+ const tab = ev . detail . tab ;
9192 const alreadySelected = this . outlet . getActiveStackId ( ) === tab ;
9293 const tabRootUrl = `${ this . outlet . tabsPrefix } /${ tab } ` ;
94+
95+ /**
96+ * If this is a nested tab, prevent the event
97+ * from bubbling otherwise the outer tabs
98+ * will respond to this event too, causing
99+ * the app to get directed to the wrong place.
100+ */
101+ ev . stopPropagation ( ) ;
102+
93103 if ( alreadySelected ) {
94104 const activeStackId = this . outlet . getActiveStackId ( ) ;
95105 const activeView = this . outlet . getLastRouteView ( activeStackId ) ;
You can’t perform that action at this time.
0 commit comments