mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Going back with the stock "Back" button on iOS will now respect the animated setting used when coming to the current page
Fixes #1787
This commit is contained in:
@ -70,10 +70,16 @@ export class Frame extends frameCommon.Frame {
|
||||
navDepth++;
|
||||
|
||||
var animated = this.currentPage ? this._getIsAnimatedNavigation(backstackEntry.entry) : false;
|
||||
if (animated) {
|
||||
var navigationTransition = this._getNavigationTransition(backstackEntry.entry);
|
||||
if (animated && navigationTransition) {
|
||||
if (navigationTransition) {
|
||||
viewController[TRANSITION] = navigationTransition;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//https://github.com/NativeScript/NativeScript/issues/1787
|
||||
viewController[TRANSITION] = { name: "non-animated" };
|
||||
}
|
||||
|
||||
backstackEntry[NAV_DEPTH] = navDepth;
|
||||
viewController[ENTRY] = backstackEntry;
|
||||
@ -551,6 +557,11 @@ class UINavigationControllerImpl extends UINavigationController implements UINav
|
||||
return super.popViewControllerAnimated(animated);
|
||||
}
|
||||
|
||||
if (navigationTransition.name === "non-animated") {
|
||||
//https://github.com/NativeScript/NativeScript/issues/1787
|
||||
return super.popViewControllerAnimated(false);
|
||||
}
|
||||
|
||||
var nativeTransition = _getNativeTransition(navigationTransition, false);
|
||||
if (!nativeTransition) {
|
||||
return super.popViewControllerAnimated(animated);
|
||||
@ -579,6 +590,11 @@ class UINavigationControllerImpl extends UINavigationController implements UINav
|
||||
return super.popToViewControllerAnimated(viewController, animated);
|
||||
}
|
||||
|
||||
if (navigationTransition.name === "non-animated") {
|
||||
//https://github.com/NativeScript/NativeScript/issues/1787
|
||||
return super.popToViewControllerAnimated(viewController, false);
|
||||
}
|
||||
|
||||
var nativeTransition = _getNativeTransition(navigationTransition, false);
|
||||
if (!nativeTransition) {
|
||||
return super.popToViewControllerAnimated(viewController, animated);
|
||||
|
Reference in New Issue
Block a user