File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ export class BottomNavigation extends TabNavigationBase {
370370
371371 toLoad . forEach ( ( index ) => {
372372 const item = items [ index ] ;
373- if ( this . isLoaded && items [ index ] ) {
373+ if ( this . isLoaded && item ) {
374374 item . loadView ( item . content ) ;
375375 }
376376 } ) ;
@@ -392,7 +392,9 @@ export class BottomNavigation extends TabNavigationBase {
392392 this . _bottomNavigationBar . setVisibility ( android . view . View . GONE ) ;
393393 }
394394
395- this . changeTab ( this . selectedIndex ) ;
395+ if ( this . _attachedToWindow ) {
396+ this . changeTab ( this . selectedIndex ) ;
397+ }
396398 }
397399
398400 _onAttachedToWindow ( ) : void {
@@ -406,7 +408,12 @@ export class BottomNavigation extends TabNavigationBase {
406408 }
407409
408410 this . _attachedToWindow = true ;
409- this . changeTab ( this . selectedIndex ) ;
411+ // add a small delay or the getRootFragmentManager wont be the right one
412+ // when "opening" the bottomnavigation page.
413+ // this should be removed once we dont need to use the root fragmentmanager
414+ setTimeout ( ( ) => {
415+ this . changeTab ( this . selectedIndex ) ;
416+ } , 0 ) ;
410417 }
411418
412419 _onDetachedFromWindow ( ) : void {
You can’t perform that action at this time.
0 commit comments