File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
angular/src/directives/navigation Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,20 @@ export class IonTabs {
86
86
* b. If the last route view doesn't exist, then navigate
87
87
* to the default tabRootUrl
88
88
*/
89
- @HostListener ( 'ionTabButtonClick' , [ '$event.detail.tab' ] )
90
- select ( tab : string ) {
89
+ @HostListener ( 'ionTabButtonClick' , [ '$event' ] )
90
+ select ( ev : CustomEvent ) {
91
+ const tab = ev . detail . tab ;
91
92
const alreadySelected = this . outlet . getActiveStackId ( ) === tab ;
92
93
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
+
93
103
if ( alreadySelected ) {
94
104
const activeStackId = this . outlet . getActiveStackId ( ) ;
95
105
const activeView = this . outlet . getLastRouteView ( activeStackId ) ;
You can’t perform that action at this time.
0 commit comments