@@ -50,6 +50,7 @@ export class SharedTransitionHelper {
5050 console . log ( `2. Take snapshots of shared elements and position them based on presenting view:` ) ;
5151 }
5252
53+ const pageOut = state . pageOut ;
5354 const pageStart = state . pageStart ;
5455
5556 const startFrame = getRectFromProps ( pageStart , getPageStartDefaultsForType ( type ) ) ;
@@ -273,6 +274,14 @@ export class SharedTransitionHelper {
273274 const endFrame = getRectFromProps ( pageEnd ) ;
274275 transition . presented . view . frame = CGRectMake ( endFrame . x , endFrame . y , endFrame . width , endFrame . height ) ;
275276
277+ if ( pageOut ) {
278+ if ( isNumber ( pageOut . opacity ) ) {
279+ transition . presenting . view . alpha = pageOut ?. opacity ;
280+ }
281+
282+ const outFrame = getRectFromProps ( pageOut ) ;
283+ transition . presenting . view . frame = CGRectMake ( outFrame . x , outFrame . y , outFrame . width , outFrame . height ) ;
284+ }
276285 // animate page properties to the following:
277286 // https://stackoverflow.com/a/27997678/1418981
278287 // In order to have proper layout. Seems mostly needed when presenting.
@@ -368,6 +377,7 @@ export class SharedTransitionHelper {
368377 console . log ( `2. Add back previously stored sharedElements to dismiss:` ) ;
369378 }
370379
380+ const pageOut = state . pageOut ;
371381 const pageEnd = state . pageEnd ;
372382 const pageEndTags = pageEnd ?. sharedTransitionTags || { } ;
373383 const pageReturn = state . pageReturn ;
@@ -457,6 +467,14 @@ export class SharedTransitionHelper {
457467 const endFrame = getRectFromProps ( pageReturn , getPageStartDefaultsForType ( type ) ) ;
458468 transition . presented . view . frame = CGRectMake ( endFrame . x , endFrame . y , endFrame . width , endFrame . height ) ;
459469
470+ if ( pageOut ) {
471+ // always return to defaults if pageOut had been used
472+ transition . presenting . view . alpha = 1 ;
473+
474+ const outFrame = getRectFromProps ( null ) ;
475+ transition . presenting . view . frame = CGRectMake ( 0 , 0 , outFrame . width , outFrame . height ) ;
476+ }
477+
460478 for ( const presenting of transition . sharedElements . presenting ) {
461479 iOSUtils . copyLayerProperties ( presenting . snapshot , presenting . view . ios , presenting . propertiesToMatch as any ) ;
462480 presenting . snapshot . frame = presenting . startFrame ;
0 commit comments