File tree Expand file tree Collapse file tree
nativescript-core/ui/page Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,6 +124,13 @@ class UIViewControllerImpl extends UIViewController {
124124 // Pages in backstack are unloaded so raise loaded here.
125125 if ( ! owner . isLoaded ) {
126126 owner . callLoaded ( ) ;
127+ } else {
128+ // Note: Handle the case of canceled backstack navigation. (https://github.com/NativeScript/NativeScript/issues/7430)
129+ // In this case viewWillAppear will be executed for the previous page and it will change the ActionBar
130+ // because changes happen in an interactive transition - IOS will animate between the the states.
131+ // If canceled - viewWillAppear will be called for the current page(which is already loaded) and we need to
132+ // update the action bar explicitly, so that it is not left styles as the previous page.
133+ owner . actionBar . update ( ) ;
127134 }
128135 }
129136
@@ -192,7 +199,7 @@ class UIViewControllerImpl extends UIViewController {
192199 if ( ! owner ) {
193200 return ;
194201 }
195-
202+
196203 // Cache presentedViewController if any. We don't want to raise
197204 // navigation events in case of presenting view controller.
198205 if ( ! owner . _presentedViewController ) {
@@ -223,7 +230,7 @@ class UIViewControllerImpl extends UIViewController {
223230 if ( ! page || page . modal || page . _presentedViewController ) {
224231 return ;
225232 }
226-
233+
227234 // Forward navigation does not remove page from frame so we raise unloaded manually.
228235 if ( page . isLoaded ) {
229236 page . callUnloaded ( ) ;
You can’t perform that action at this time.
0 commit comments