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
formSheet presentation only opening half-way in 3.19.0 #1686
Comments
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
Hey! 👋 It looks like you've omitted a few important sections from the issue template. Please complete Snack or a link to a repository section. |
After further investigation, it appears that the medium detent PR was actually merged in 3.19.0? 3.18.2...3.19.0 the changelog is showing it as included in 3.19.0. It also looks there was a PR e20f54c that removed the props for controlling the detents, so my best guess is the default size is somehow set to medium/half, but we have no way of controlling it since the props were temporarily removed until the feature is ready for prime time. |
Yeah, this might be a my mistake, as I've left some part of native implementation intact... But while testing I didn't notice the change of default behaviour. I'll check this & let you know |
Yep, everything works fine on main, I've made mistake when removing public API and wrong default value is passed in It will be fixed with next minor version (won't give you details, but it should not be long from now). |
Hey @kkafar, when do you plan to release |
@kkafar this issue has not been resolved yet as we're still on 3.19 and Expo SDK 48 is about to ship with 3.19.0. Could we get a 3.19.1 to be shipped with Expo SDK 48 before its too late? Thanks! |
Should be fixed with: https://github.com/software-mansion/react-native-screens/releases/tag/3.20.0 Edit: let me know whether it works fine again also on your side |
@kkafar the issue was fixed in 3.20.0 but was re-introduced again in later versions. just hit this with 3.22.0. |
Hey @adamivancza, I've just tested it on main -- seems to me that sheet presentation works just fine. import * as React from 'react';
import {Button, StyleSheet, View, Text, ScrollView} from 'react-native';
import {NavigationContainer, ParamListBase} from '@react-navigation/native';
import {
createNativeStackNavigator,
NativeStackNavigationProp,
} from 'react-native-screens/native-stack';
import {SheetDetentTypes} from 'react-native-screens';
const Stack = createNativeStackNavigator();
export default function App(): JSX.Element {
return (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
// headerRight: () => <View style={styles.headerView} />,
headerTitleStyle: {
color: 'cyan',
},
headerShown: true,
headerHideBackButton: false,
}}>
<Stack.Screen name="First" component={First} />
<Stack.Screen
name="SheetScreen"
component={SheetScreen}
options={{
stackPresentation: 'formSheet',
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
function First({
navigation,
}: {
navigation: NativeStackNavigationProp<ParamListBase>;
}) {
return (
<Button
title="Tap me for the second screen"
onPress={() => navigation.navigate('SheetScreen')}
/>
);
}
function SheetScreen({
navigation,
}: {
navigation: NativeStackNavigationProp<ParamListBase>;
}) {
return (
<View style={styles.centeredView}>
<Button
title="Tap me for the first screen"
onPress={() => navigation.navigate('First')}
/>
<Button
title="Tap me for the second screen"
onPress={() => navigation.navigate('Second')}
/>
</View>
);
}
const styles = StyleSheet.create({
headerView: {
height: 20,
width: 20,
backgroundColor: 'red',
},
centeredView: {
justifyContent: 'center',
alignItems: 'center',
},
}); The sheet opens by default to full height. Provide me with repro / give more detail please. |
hey @kkafar! Maybe you're using something outdated in your repro as |
@adamivancza, I see now. |
full repro project: |
@adamivancza, You can put the following in your "react-native-screens": "software-mansion/react-native-screens#@kkafar/check-sheet-presentation-on-ios" Let me know whether the fix works. |
…nnerScreen` (#1811) ## Description Default values for medium-detent related props were set only in `NativeStackView` so only in case user used native stack directly from `react-native-screens`. This led to buggy behaviour when `@react-navigation/native-stack` was in use. See conversation: #1686 (comment) ## Changes Default prop values are now set in `InnerScreen` in `index.native.tsx` which is used internally by `@react-navigation/native-stack` package. # Test case See conversation: #1686 (comment) (and below). Use `stackPresentation: 'formSheet'` with native stack from `@react-navigation/native-stack` and see that the modal is opened by default to full height. ## Checklist - [x] Ensured that CI passes
yeah, I can confirm that works fine @kkafar! thx for the quick fix 😉 |
@adamivancza It's already released (should be avaiable directly from NPM) |
…nnerScreen` (#1811) ## Description Default values for medium-detent related props were set only in `NativeStackView` so only in case user used native stack directly from `react-native-screens`. This led to buggy behaviour when `@react-navigation/native-stack` was in use. See conversation: software-mansion/react-native-screens#1686 (comment) ## Changes Default prop values are now set in `InnerScreen` in `index.native.tsx` which is used internally by `@react-navigation/native-stack` package. # Test case See conversation: software-mansion/react-native-screens#1686 (comment) (and below). Use `stackPresentation: 'formSheet'` with native stack from `@react-navigation/native-stack` and see that the modal is opened by default to full height. ## Checklist - [x] Ensured that CI passes
Description
formSheet presentation screens are only opening half-way in 3.19.0. I reverted to 3.18.2 and everything works as normal. Looking through the change logs I'm not seeing anything obvious to the cause of this. Originally I had thought the new formSheet detent PR had merged/released, but it hasn't yet #1649 (comment). I have only tried on the "old architecture". The two screenshots below show 3.19.0 and 3.18.2, respectively, with no other changes made besides the version.
3.19.0
3.18.2
Steps to reproduce
'presentation: 'formSheet'
on a screenSnack or a link to a repository
.
Screens version
3.19.0
React Native version
0.71.0
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: