File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
src/components/BottomNavigation Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -429,13 +429,26 @@ const BottomNavigationBar = <Route extends BaseRoute>({
429429 easing : animationEasing ,
430430 } )
431431 ) ,
432- ] ) . start ( ( ) => {
433- // Workaround a bug in native animations where this is reset after first animation
434- tabsAnims . map ( ( tab , i ) => tab . setValue ( i === index ? 1 : 0 ) ) ;
435-
436- // Update the index to change bar's background color and then hide the ripple
432+ ] ) . start ( ( result ) => {
433+ // Explicitly finish animation state to avoid RN 0.80 drops leaving tabs half-focused
434+ tabsAnims . forEach ( ( tab , i ) => {
435+ tab . stopAnimation ( ) ;
436+ tab . setValue ( i === index ? 1 : 0 ) ;
437+ } ) ;
438+
439+ indexAnim . stopAnimation ( ) ;
437440 indexAnim . setValue ( index ) ;
441+
442+ rippleAnim . stopAnimation ( ) ;
438443 rippleAnim . setValue ( MIN_RIPPLE_SCALE ) ;
444+
445+ if ( result ?. finished === false ) {
446+ requestAnimationFrame ( ( ) => {
447+ tabsAnims . forEach ( ( tab , i ) => tab . setValue ( i === index ? 1 : 0 ) ) ;
448+ indexAnim . setValue ( index ) ;
449+ rippleAnim . setValue ( MIN_RIPPLE_SCALE ) ;
450+ } ) ;
451+ }
439452 } ) ;
440453 } ,
441454 [
You can’t perform that action at this time.
0 commit comments