@@ -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,7 +91,10 @@ export abstract class BottomNavigationBarBase extends View {
8991 index,
9092 } ;
9193 this . notify ( eventData ) ;
92- this . removeBadge ( index ) ;
94+
95+ if ( this . autoClearBadge ) {
96+ this . removeBadge ( index ) ;
97+ }
9398 }
9499
95100 _emitTabSelected ( index : number ) {
@@ -101,7 +106,10 @@ export abstract class BottomNavigationBarBase extends View {
101106 } ;
102107 this . selectedTabIndex = index ;
103108 this . notify ( eventData ) ;
104- this . removeBadge ( index ) ;
109+
110+ if ( this . autoClearBadge ) {
111+ this . removeBadge ( index ) ;
112+ }
105113 }
106114
107115 _emitTabReselected ( index : number ) {
@@ -150,6 +158,14 @@ export const titleVisibilityProperty = new Property<BottomNavigationBarBase, Tit
150158
151159titleVisibilityProperty . register ( BottomNavigationBarBase ) ;
152160
161+ export const autoClearBadgeProperty = new Property < BottomNavigationBarBase , boolean > ( {
162+ name : 'autoClearBadge' ,
163+ defaultValue : true ,
164+ valueConverter : booleanConverter ,
165+ } ) ;
166+
167+ autoClearBadgeProperty . register ( BottomNavigationBarBase ) ;
168+
153169export const activeColorCssProperty = new CssProperty < Style , Color > ( {
154170 name : 'activeColor' ,
155171 cssName : 'active-color' ,
0 commit comments