@@ -237,6 +237,21 @@ export class Frame extends FrameBase {
237237 this . backgroundColor = this . _originalBackground ;
238238 this . _originalBackground = null ;
239239 }
240+ setTimeout ( ( ) => {
241+ // there's a bug with nested frames where sometimes the nested fragment is not recreated at all
242+ // so we manually check on loaded event if the fragment is not recreated and recreate it
243+ const currentEntry = this . _currentEntry || this . _executingContext ?. entry ;
244+ if ( currentEntry ) {
245+ if ( ! currentEntry . fragment ) {
246+ const manager = this . _getFragmentManager ( ) ;
247+ const transaction = manager . beginTransaction ( ) ;
248+ currentEntry . fragment = this . createFragment ( currentEntry , currentEntry . fragmentTag ) ;
249+ _updateTransitions ( currentEntry ) ;
250+ transaction . replace ( this . containerViewId , currentEntry . fragment , currentEntry . fragmentTag ) ;
251+ transaction . commitAllowingStateLoss ( ) ;
252+ }
253+ }
254+ } , 0 ) ;
240255
241256 super . onLoaded ( ) ;
242257 }
@@ -1002,6 +1017,19 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
10021017 }
10031018 }
10041019
1020+ @profile
1021+ public onResume ( fragment : org . nativescript . widgets . FragmentBase , superFunc : Function ) : void {
1022+ const frame = this . entry . resolvedPage . frame ;
1023+ // on some cases during the first navigation on nested frames the animation doesn't trigger
1024+ // we depend on the animation (even None animation) to set the entry as the current entry
1025+ // animation should start between start and resume, so if we have an executing navigation here it probably means the animation was skipped
1026+ // so we manually set the entry
1027+ if ( frame . _executingContext && ! ( < any > this . entry ) . isAnimationRunning ) {
1028+ frame . setCurrent ( this . entry , frame . _executingContext . navigationType ) ;
1029+ }
1030+ superFunc . call ( fragment ) ;
1031+ }
1032+
10051033 @profile
10061034 public onStop ( fragment : androidx . fragment . app . Fragment , superFunc : Function ) : void {
10071035 superFunc . call ( fragment ) ;
0 commit comments