File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ class TabBar extends Component<TabBarProps, State> {
104
104
// between this.props and nextProps (basically the meaning of selectedIndex should be initialIndex)
105
105
const isIndexManuallyChanged =
106
106
nextProps . selectedIndex !== this . state . currentIndex && this . props . selectedIndex !== nextProps . selectedIndex ;
107
- if ( isIndexManuallyChanged ) {
107
+ if ( isIndexManuallyChanged && nextProps . selectedIndex !== undefined ) {
108
108
this . updateIndicator ( nextProps . selectedIndex ) ;
109
109
}
110
110
}
@@ -125,13 +125,11 @@ class TabBar extends Component<TabBarProps, State> {
125
125
return _ . get ( child , 'props.ignore' ) ;
126
126
}
127
127
128
- updateIndicator ( index ?: number ) {
129
- if ( index ) {
130
- if ( ! this . isIgnored ( index ) ) {
131
- this . setState ( { currentIndex : index } , ( ) => {
132
- this . scrollToSelected ( ) ;
133
- } ) ;
134
- }
128
+ updateIndicator ( index : number ) {
129
+ if ( ! this . isIgnored ( index ) ) {
130
+ this . setState ( { currentIndex : index } , ( ) => {
131
+ this . scrollToSelected ( ) ;
132
+ } ) ;
135
133
}
136
134
}
137
135
You can’t perform that action at this time.
0 commit comments