Top part (Handle component) bottomsheet slightly visible even the initial index value is set to -1
See original GitHub issueBug
The top part of bottomsheet (Handle component) slightly visible on screen mount even i already set the initial index value to -1. But when i close it from ref methods .close()
it closed perferctly without any top part being visible. The issue only occur on the devices like Samsung S20.
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | ^2 |
react-native | 0.63.4 |
react-native-reanimated | ^1.9.0 |
react-native-gesture-handler | ^1.5.6 |
Steps To Reproduce
- I followed the example from this Dynamic height bottomsheet
Describe what you expected to happen:
- Top part bottomsheet should not be visible when the initial index props value is set to -1
Reproducible sample code
const [contentHeight, setContentHeight] = useState(0);
const snapPoints = useMemo(() => [0, contentHeight], [contentHeight]);
const easing = Easing.out(Easing.bezier(0.78, -0.4, 0.32, 1.6));
// Methods
const onLayoutSheetContainer = ({nativeEvent}) => {
const layoutHeight = get(nativeEvent, 'layout.height', 0);
setContentHeight(layoutHeight);
};
// Render
return (
<BottomSheet
index={-1}
snapPoints={snapPoints}
animationDuration={750}
animationEasing={easing}
handleComponent={HandleComponent}
backdropComponent={BottomSheetBackdrop}
backgroundComponent={BackgroundComponent}>
<View
style={styles.autoResizeContainer}
onLayout={onLayoutSheetContainer}>
{props.children}
</View>
</BottomSheet>
);
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How do you adjust the height and borderRadius of a ...
Default height for bottomSheet is half the screenSize. If you want your bottomSheet to EXPAND according to your content DYNAMICALLY.
Read more >BottomSheetBehavior - Android Developers
An interaction behavior plugin for a child view of CoordinatorLayout to make it work as a bottom sheet. To send useful accessibility events, ......
Read more >Sheets: bottom - Material Design
Bottom sheets are surfaces containing supplementary content that are anchored to the bottom of the screen.
Read more >How to Use Buttons, Check Boxes, and Radio Buttons
First, this section explains the basic button API that AbstractButton defines ... At most one button in a top-level container can be the...
Read more >Handling Scrolls with CoordinatorLayout - CodePath Cliffnotes
The first step is to make sure you are not using the deprecated ActionBar. Make sure to follow the Using the ToolBar as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gorhom I had the same issue on Pixel 4a, your fix works.
Hi @gorhom I still facing this issue in v4 Here is the screenshot
Here is the handle component
I’ve tried to put
topInset={StatusBar.currentHeight}
but in the first render, the handle still visible