react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

[v4] | [v2] BottomSheetModal is not showing along with React Native Modal

Open ursnj opened this issue 2 years ago • 2 comments

Bug

BottomSheetModal is not showing along with ReactNativeModal.

I think Modal coming on top of Bottom Sheet, but not sure.

Environment info

Library Version
@gorhom/bottom-sheet 4.3.2
react-native 0.67.1
react-native-reanimated 2.3.1
react-native-gesture-handler 1.10.3

Steps To Reproduce

Describe what you expected to happen:

Reproducible sample code

ursnj avatar Jul 13 '22 08:07 ursnj

Is this library is bot maintained anymore ???

ursnj avatar Aug 05 '22 01:08 ursnj

React Native Modal is a native view that sit above your react native application therefore the Native modal will hide everything pure JavaScript/TypeScript

Your bottom sheet must be used within a Modal to be shown

Waryen avatar Aug 12 '22 13:08 Waryen

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.

github-actions[bot] avatar Sep 12 '22 09:09 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 18 '22 09:09 github-actions[bot]

+1

738 avatar Dec 11 '22 15:12 738

It will work if you wrap all the content of the modal in <BottomSheetModalProvider>

arunabhverma avatar Aug 08 '23 13:08 arunabhverma

It will work if you wrap all the content of the modal in

@arunabhverma Can you explain what you meant?

iraybi avatar Sep 03 '23 14:09 iraybi

Let me provide you with some code.

arunabhverma avatar Sep 03 '23 14:09 arunabhverma

Let me provide you with some code.

@arunabhverma It'll be a great help if you can do so. Thank you

iraybi avatar Sep 03 '23 14:09 iraybi

<Modal {...modalProps}>
  <BottomSheetModalProvider>
    <BottomSheetModal
          ref={bottomSheetModalRef}
          index={1}
          snapPoints={snapPoints}
          onChange={handleSheetChanges}
        >
          <View style={styles.contentContainer}>
            <Text>Awesome 🎉</Text>
          </View>
        </BottomSheetModal>
  </BottomSheetModalProvider>
</Modal>

Try this one

arunabhverma avatar Sep 03 '23 14:09 arunabhverma

@arunabhverma

Working now. Thanks! So the solution is

<Modal> <BottomSheetModalProvider> // Your child content goes here </BottomSheetModalProvider> </Modal>

iraybi avatar Sep 03 '23 14:09 iraybi

Yes @iraybi

arunabhverma avatar Sep 03 '23 14:09 arunabhverma

@arunabhverma , but now the gesture or modal closing behavior is not working anymore. Once opened, the bottomsheet stucks

iraybi avatar Sep 03 '23 14:09 iraybi

Could you please provide me your code? I will look into it.

arunabhverma avatar Sep 03 '23 14:09 arunabhverma

@arunabhverma, I am using the same concept but, close on swipe not working not able to close.

sarthakmeta avatar Feb 24 '24 16:02 sarthakmeta

@sarthakmeta It because of gesture conflicting between screen and bottom sheet.

arunabhverma avatar Feb 28 '24 08:02 arunabhverma

@sarthakmeta you can try this code, it should resolve your issue.

import { NativeViewGestureHandler } from 'react-native-gesture-handler';

<NativeViewGestureHandler disallowInterruption={true}>
   <AwesomeComponent />
</NativeViewGestureHandler>

arunabhverma avatar Feb 28 '24 09:02 arunabhverma

@arunabhverma Working now. Thanks!🙏

sarthakmeta avatar Feb 28 '24 16:02 sarthakmeta