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(iOS,Paper): fix broken modal go-back animation #2496

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion apps/src/tests/TestModalNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ function HomeScreen({
title="Navigate to Screen 1"
onPress={() => navigation.navigate('NestedStack')}
/>
<Button
title="Navigate to Screen (same stack)"
onPress={() => navigation.navigate('MainStackScreen')}
/>
</View>
);
}

function MainStackScreen() {
function MainStackScreen({ navigation }: NativeStackScreenProps<StackParamList, 'MainStackScreen'>) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Main stack screen</Text>
<Button
title="goBack"
onPress={() => navigation.goBack()}
/>
</View>
);
}
Expand Down
2 changes: 1 addition & 1 deletion ios/RNSScreenStack.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ - (void)invalidate
// with modal presentation or foreign modal presented from inside a Screen.
- (void)dismissAllRelatedModals
{
[_controller dismissViewControllerAnimated:NO completion:nil];
[_controller dismissViewControllerAnimated:YES completion:nil];

// This loop seems to be excessive. Above message send to `_controller` should
// be enough, because system dismisses the controllers recursively,
Expand Down
Loading