[v4] Backdrop press to close and enablePanDownToClose doesn't work on physical Android devices
See original GitHub issueBug
Backdrop press to close and enablePanDownToClose doesn’t work on physical Android devices.
Children of the bottom sheet are clickable, but backdrop doesn’t react to touches, as does the pan down to close.
Tested on all versions of v4. The backdrop press works on v2.
v4 - both features do work fine on iOS.
v2 Doesn’t allow to swipe down on physical Android devices even with snapPoints set to [-250,250].
Environment info
Xiaomi Redmi Note 8 Pro
Library | Version |
---|---|
@gorhom/bottom-sheet | 4.1.0 |
react-native | 0.64.2 |
react-native-reanimated | 2.2.2 |
react-native-gesture-handler | 1.10.3 |
Steps To Reproduce
- Open the screen with bottom sheet included
- Open the bottom sheet
- Press on the backdrop (nothing happens)
- Pan down to close (nothing happens)
Describe what you expected to happen:
- Press on backdrop should close the bottom sheet.
- Pan down should close the bottom sheet.
Reproducible sample code
import React, { useCallback } from 'react';
import { Text } from 'react-native';
import BottomSheet, { BottomSheetBackdrop } from '@gorhom/bottom-sheet';
export const RateAppSheet: React.FC = () => {
const renderBackdrop = useCallback(
props => <BottomSheetBackdrop disappearsOnIndex={-1} appearsOnIndex={0} {...props} />,
[],
);
return (
<BottomSheet
ref={ref}
index={-1}
enablePanDownToClose={true}
snapPoints={[250]}
backdropComponent={renderBackdrop}
>
<Text>Hello, the backdrop and pan down isn't working on physical android devices on v4</Text>
</BottomSheet>
);
},
);
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11
Top Results From Across the Web
[v4] `enablePanDownToClose` not working on iOS and ...
I nested the bottomSheet in a react-native-modal component and use the modal backdrop for onClose. The prop enablePanDownToClose is not working ...
Read more >Bottom sheet is not getting closed in react native android
I am unable to close or swap top bottom the bottomsheet in android only. Also when keyboard appears this bottomsheet keeps transparent ...
Read more >Props | React Native Bottom Sheet - GitHub Pages
enablePanDownToClose . Enable pan down gesture to close the sheet. ... backgroundStyle . View style to be applied to the background component.
Read more >react native modal keyboard avoiding
I'm trying to use a keyboard avoiding view to basically push up the entire app window on iOS (mocking the behavior seen by...
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
I was missing the GestureHandlerRootView wrapper in my App. Works alright now.
This solved it for me also. For others that see a broken screen - you may need to add style={{flex:1}} to the <GestureHandlerRootView /> tag.