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) {
|
if (fragment != null) {
|
||||||
fragment.setMenuVisibility(true);
|
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;
|
this._currentFragment = fragment;
|
||||||
@@ -581,8 +583,8 @@ export class BottomNavigation extends TabNavigationBase {
|
|||||||
fragmentExitTransition.setResetOnTransitionEnd(true);
|
fragmentExitTransition.setResetOnTransitionEnd(true);
|
||||||
}
|
}
|
||||||
if (fragment && fragment.isAdded() && !fragment.isRemoving()) {
|
if (fragment && fragment.isAdded() && !fragment.isRemoving()) {
|
||||||
const pfm = (<any>fragment).getParentFragmentManager ? (<any>fragment).getParentFragmentManager() : null;
|
const pfm = (<any>fragment).getParentFragmentManager ? (<any>fragment).getParentFragmentManager() : fragmentManager;
|
||||||
if (pfm && !pfm.isDestroyed()) {
|
if (pfm) {
|
||||||
try {
|
try {
|
||||||
if (pfm.isStateSaved()) {
|
if (pfm.isStateSaved()) {
|
||||||
pfm.beginTransaction().remove(fragment).commitNowAllowingStateLoss();
|
pfm.beginTransaction().remove(fragment).commitNowAllowingStateLoss();
|
||||||
|
|||||||
Reference in New Issue
Block a user