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 {
370
370
371
371
toLoad . forEach ( ( index ) => {
372
372
const item = items [ index ] ;
373
- if ( this . isLoaded && items [ index ] ) {
373
+ if ( this . isLoaded && item ) {
374
374
item . loadView ( item . content ) ;
375
375
}
376
376
} ) ;
@@ -392,7 +392,9 @@ export class BottomNavigation extends TabNavigationBase {
392
392
this . _bottomNavigationBar . setVisibility ( android . view . View . GONE ) ;
393
393
}
394
394
395
- this . changeTab ( this . selectedIndex ) ;
395
+ if ( this . _attachedToWindow ) {
396
+ this . changeTab ( this . selectedIndex ) ;
397
+ }
396
398
}
397
399
398
400
_onAttachedToWindow ( ) : void {
@@ -406,7 +408,12 @@ export class BottomNavigation extends TabNavigationBase {
406
408
}
407
409
408
410
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 ) ;
410
417
}
411
418
412
419
_onDetachedFromWindow ( ) : void {
You can’t perform that action at this time.
0 commit comments