Open kav opened 2 months ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Still a problem.
+1 victim of this bug
From my tests, it only appears to be the case in some scenarios. My solution was to just use another view instead of
import React, { useCallback, useMemo, useRef } from 'react';
import { View, Text, StyleSheet, Button, TextInput } from 'react-native';
import BottomSheet, { BottomSheetView } from '@gorhom/bottom-sheet';
import { ScrollView } from 'react-native-gesture-handler';
const ManualForm = () => {
// ref
const bottomSheetRef = useRef<BottomSheet>(null);
// callbacks
const handleSheetChanges = useCallback((index: number) => {
console.log('handleSheetChanges', index);
}, []);
return (
<View style={styles.container}>
<BottomSheet
ref={bottomSheetRef}
onChange={handleSheetChanges}
snapPoints={['5%', '25%', '50%', '75%', '90%']}
>
<BottomSheetView style={styles.contentContainer}>
<Button title="a Button"/>
</BottomSheetView>
<View>
<Button title="In Regular View"/>
</View>
<ScrollView>
<Button title="In ScrollView"/>
</ScrollView>
</BottomSheet>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 24,
backgroundColor: 'grey',
},
contentContainer: {
flex: 1,
alignItems: 'center',
},
textInput: {
borderColor: 'lightgray',
borderWidth: 2,
padding: 5,
fontSize: 20
}
});
export default ManualForm;
In the example above, neither ScrollView nor View exhibit the same sort of issue. It might also be possible to not wrap the items
*** This was tested on Expo Go
I have the same problem still on 4.6.4. Changing BottomSheetView
to View
doesn't seem to do anything in my case. It's only on iOS and sometimes it crops just one button, sometimes more. It's kind of a show stopper unfortunately.
Edit: I noticed that v4 is not maintained anymore, so I installed 5.0.0-alpha.11 instead. The problem persisted, but when I changed enableDynamicSizing
to true (and added back BottomSheetView
) it now works perfectly.
Bug
Buttons appearing inside a bottom sheet (on IOS) get cropped off. This behavior is random and does not occur every time, the best way to reproduce is to constantly refresh the app. This happens in the simulator and on my ios device.
Another example:
Environment info
Library Version @gorhom/bottom-sheet 4.6.0 react-native 0.74.2 react-native-reanimated 3.10.1 react-native-gesture-handler 2.16.1
Steps To Reproduce
Expected behavior:
Text does not get cut off:
Reproducible sample code
Note this was also reported in 2021 ( https://github.com/gorhom/react-native-bottom-sheet/issues/645 ) but the issue was closed And again in 2022 https://github.com/gorhom/react-native-bottom-sheet/issues/1218 but again the issue was closed