Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): ActionBar style wrong after cancelled swipe back navigation #8252

Merged
merged 4 commits into from Jan 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions nativescript-core/ui/page/page.ios.ts
Expand Up @@ -124,6 +124,13 @@ class UIViewControllerImpl extends UIViewController {
// Pages in backstack are unloaded so raise loaded here.
if (!owner.isLoaded) {
owner.callLoaded();
} else {
// Note: Handle the case of canceled backstack navigation. (https://github.com/NativeScript/NativeScript/issues/7430)
// In this case viewWillAppear will be executed for the previous page and it will change the ActionBar
// because changes happen in an interactive transition - IOS will animate between the the states.
// If canceled - viewWillAppear will be called for the current page(which is already loaded) and we need to
// update the action bar explicitly, so that it is not left styles as the previous page.
owner.actionBar.update();
}
}

Expand Down Expand Up @@ -192,7 +199,7 @@ class UIViewControllerImpl extends UIViewController {
if (!owner) {
return;
}

// Cache presentedViewController if any. We don't want to raise
// navigation events in case of presenting view controller.
if (!owner._presentedViewController) {
Expand Down Expand Up @@ -223,7 +230,7 @@ class UIViewControllerImpl extends UIViewController {
if (!page || page.modal || page._presentedViewController) {
return;
}

// Forward navigation does not remove page from frame so we raise unloaded manually.
if (page.isLoaded) {
page.callUnloaded();
Expand Down