@@ -34,6 +34,7 @@ export interface TabSelectedEventData extends EventData {
3434export interface TabReselectedEventData extends EventData {
3535 index : number ;
3636}
37+
3738/**
3839 * Enum for Title Visibility options
3940 *
@@ -59,6 +60,7 @@ export abstract class BottomNavigationBarBase extends View {
5960
6061 selectedTabIndex = 0 ;
6162 titleVisibility : TitleVisibility = TitleVisibility . always ;
63+ autoClearBadge : boolean ;
6264
6365 protected _items : BottomNavigationTabBase [ ] = [ ] ;
6466
@@ -89,6 +91,10 @@ export abstract class BottomNavigationBarBase extends View {
8991 index,
9092 } ;
9193 this . notify ( eventData ) ;
94+
95+ if ( this . autoClearBadge ) {
96+ this . removeBadge ( index ) ;
97+ }
9298 }
9399
94100 _emitTabSelected ( index : number ) {
@@ -100,6 +106,10 @@ export abstract class BottomNavigationBarBase extends View {
100106 } ;
101107 this . selectedTabIndex = index ;
102108 this . notify ( eventData ) ;
109+
110+ if ( this . autoClearBadge ) {
111+ this . removeBadge ( index ) ;
112+ }
103113 }
104114
105115 _emitTabReselected ( index : number ) {
@@ -148,6 +158,14 @@ export const titleVisibilityProperty = new Property<BottomNavigationBarBase, Tit
148158
149159titleVisibilityProperty . register ( BottomNavigationBarBase ) ;
150160
161+ export const autoClearBadgeProperty = new Property < BottomNavigationBarBase , boolean > ( {
162+ name : 'autoClearBadge' ,
163+ defaultValue : true ,
164+ valueConverter : booleanConverter ,
165+ } ) ;
166+
167+ autoClearBadgeProperty . register ( BottomNavigationBarBase ) ;
168+
151169export const activeColorCssProperty = new CssProperty < Style , Color > ( {
152170 name : 'activeColor' ,
153171 cssName : 'active-color' ,
0 commit comments