2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { AssetService } from '../adapters/AssetResolver';
13
13
import { Deprecations } from './Deprecations' ;
14
14
import { CommandName } from '../interfaces/CommandName' ;
15
15
import { OptionsProcessor as Processor } from '../interfaces/Processors' ;
16
+ import { Platform } from 'react-native' ;
16
17
17
18
describe ( 'navigation options' , ( ) => {
18
19
let uut : OptionsProcessor ;
@@ -52,7 +53,8 @@ describe('navigation options', () => {
52
53
) ;
53
54
} ) ;
54
55
55
- it ( 'processes old setRoot animation value to new enter exit format' , ( ) => {
56
+ it ( 'processes old setRoot animation value to new enter exit format on Android' , ( ) => {
57
+ Platform . OS = 'android' ;
56
58
const options : Options = {
57
59
animations : {
58
60
setRoot : {
@@ -84,6 +86,7 @@ describe('navigation options', () => {
84
86
uut . processOptions ( options , CommandName . SetRoot ) ;
85
87
expect ( options ) . toEqual ( expectedOptions ) ;
86
88
} ) ;
89
+
87
90
describe ( 'Modal Animation Options' , ( ) => {
88
91
describe ( 'Show Modal' , ( ) => {
89
92
it ( 'processes old options into new options,backwards compatibility ' , ( ) => {
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
25
25
import { Deprecations } from './Deprecations' ;
26
26
import { OptionProcessorsStore } from '../processors/OptionProcessorsStore' ;
27
27
import { CommandName } from '../interfaces/CommandName' ;
28
+ import { Platform } from 'react-native' ;
28
29
29
30
export class OptionsProcessor {
30
31
constructor (
@@ -284,10 +285,12 @@ export class OptionsProcessor {
284
285
parentOptions : AnimationOptions
285
286
) {
286
287
if ( key !== 'setRoot' ) return ;
287
- if ( ! ( 'enter' in animation ) ) {
288
+ if ( Platform . OS === 'android' && ! ( 'enter' in animation ) ) {
288
289
parentOptions . setRoot = {
289
290
enter : animation ,
290
291
} as EnterExitAnimationOptions ;
292
+ } else if ( Platform . OS === 'ios' && 'enter' in animation ) {
293
+ parentOptions . setRoot = animation ;
291
294
}
292
295
}
293
296
0 commit comments