File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/core-tabs/tab-navigation-base Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ export interface SelectedIndexChangedEventData extends EventData {
27
27
28
28
export class TabNavigationBase extends View implements TabNavigationBaseDefinition , AddChildFromBuilder , AddArrayFromBuilder {
29
29
public static selectedIndexChangedEvent = 'selectedIndexChanged' ;
30
+ public static selectedEvent = 'selected' ;
31
+ public static unselectedEvent = 'unselected' ;
30
32
31
33
public unloadOnTabChange : boolean ;
32
34
public items : TabContentItem [ ] ;
@@ -121,7 +123,19 @@ export class TabNavigationBase extends View implements TabNavigationBaseDefiniti
121
123
}
122
124
123
125
public onSelectedIndexChanged ( oldIndex : number , newIndex : number ) : void {
124
- // to be overridden in platform specific files
126
+ const items = this . items ;
127
+ if ( items [ oldIndex ] ) {
128
+ items [ oldIndex ] . content . notify ( {
129
+ eventName : TabNavigationBase . unselectedEvent ,
130
+ object : this
131
+ } ) ;
132
+ }
133
+ if ( items [ newIndex ] ) {
134
+ items [ newIndex ] . content . notify ( {
135
+ eventName : TabNavigationBase . selectedEvent ,
136
+ object : this
137
+ } ) ;
138
+ }
125
139
this . notify ( {
126
140
eventName : TabNavigationBase . selectedIndexChangedEvent ,
127
141
object : this ,
You can’t perform that action at this time.
0 commit comments