mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(bottom-navigation): fragment handling (#9244)
This commit is contained in:
@@ -540,7 +540,9 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
|
||||
if (fragment != null) {
|
||||
fragment.setMenuVisibility(true);
|
||||
fragment.setUserVisibleHint(true);
|
||||
// commenting out as it fixes rare crash when going
|
||||
// back from deeply nested/modally shown fragments
|
||||
// fragment.setUserVisibleHint(true);
|
||||
}
|
||||
|
||||
this._currentFragment = fragment;
|
||||
@@ -581,8 +583,8 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
fragmentExitTransition.setResetOnTransitionEnd(true);
|
||||
}
|
||||
if (fragment && fragment.isAdded() && !fragment.isRemoving()) {
|
||||
const pfm = (<any>fragment).getParentFragmentManager ? (<any>fragment).getParentFragmentManager() : null;
|
||||
if (pfm && !pfm.isDestroyed()) {
|
||||
const pfm = (<any>fragment).getParentFragmentManager ? (<any>fragment).getParentFragmentManager() : fragmentManager;
|
||||
if (pfm) {
|
||||
try {
|
||||
if (pfm.isStateSaved()) {
|
||||
pfm.beginTransaction().remove(fragment).commitNowAllowingStateLoss();
|
||||
|
||||
Reference in New Issue
Block a user