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: Make all screens after presentation: 'modal' as modal unless specified #11860

17 changes: 11 additions & 6 deletions packages/native-stack/src/views/NativeStackView.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,17 @@ const SceneView = ({
}: SceneViewProps) => {
const { route, navigation, options, render } = descriptor;

let {
animation,
animationMatchesGesture,
fullScreenGestureEnabled,
presentation = 'card',
} = options;
let { animation, animationMatchesGesture, fullScreenGestureEnabled } =
options;

if (
!options.presentation &&
previousDescriptor?.options.presentation === 'modal'
) {
options.presentation = 'modal';
satya164 marked this conversation as resolved.
Show resolved Hide resolved
}

let presentation = options.presentation ?? 'card';

const {
animationDuration,
Expand Down
7 changes: 7 additions & 0 deletions packages/stack/src/views/Stack/CardStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ export class CardStack extends React.Component<Props, State> {
? nextDescriptor.options
: descriptor.options;

if (
previousDescriptor?.options.presentation === 'modal' ||
descriptor?.options.presentation === 'modal'
) {
optionsForTransitionConfig.presentation = 'modal';
}

const defaultTransitionPreset =
optionsForTransitionConfig.presentation === 'modal'
? ModalTransition
Expand Down
Loading