Invisible bottom sheet gets stuck in the center of the screen on Android
See original GitHub issueHello,
The panel sometimes gets stuck in the middle of the screen on first app load. And it’s invisible. It prevents me from clicking on the map. Android only. iOS is ok.
I noticed that this happens when initialSnap reference to not maximal value. In my example: initialSnap = 0 works normally. And the panel is in it’s max size.
Map and panel components is on one level and wrapped in one flex container with no other params. Bug occurs more often on slow Android devices, or in debug mode.
const content = ({ children, height }) => (
<View style={[styles.panel, { height }]}>
{children}
</View>
);
const renderHeader = () => (
<View style={styles.header}>
<View style={styles.panelHeader}>
<View style={styles.panelHandle} />
</View>
</View>
);
const MapPanel = ({ panelRef, children, height }) => (
<BottomSheet
ref={panelRef}
snapPoints={[600, 300, 0]}
renderContent={() => content({ children, height })}
renderHeader={renderHeader}
initialSnap={2}
/>
);
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:10
Top Results From Across the Web
Bottom sheet stays on screen when activity is recreated
The issue I encountered is when user exists the app (with the bottom sheet expanded) and later comes back to the app, the...
Read more >Modal Bottom Sheets - Material Design
BottomSheetBehavior works in tandem with CoordinatorLayout to let you display content on a bottom sheet, perform enter/exit animations, respond to dragging/ ...
Read more >How to fix Maps when it crashes - Android - Google Maps Help
Clear storage in the Settings app on your device. Android iPhone & iPad.
Read more >Android Bottom Sheet Behavior and Animated Button on Top ...
Bottom Sheets are surface components that hold supplementary content. It mostly anchored the bottom of the screen. In simple words, you can ...
Read more >Troubleshooting | React Native Bottom Sheet - GitHub Pages
Pressables / Touchables are not working on Android ... Due to wrapping the content and handle with TapGestureHandler & PanGestureHandler , any gesture ......
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 Free
Top 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
I invented super-crutch 😃
make ref of a View in contentRender. I called it contentRef.
this is a try to define if panel is in wrong place and hide it. ‘top’ is a top snapPoint
but it not always work, that’s why i do this in componentDidMount
i know it’s terrible 😦 but it works in my сase. waiting for the fix from the author
Here’s what I ended up doing that has been working consistently so far (YMMV). I set the initial snap to the last snap point index. When the component mounts, I then set the desired snap position.
Hopefully this will help someone else out until we can get an official fix.