gorhom / react-native-bottom-sheet

A performant interactive bottom sheet with fully configurable options 🚀
https://gorhom.dev/react-native-bottom-sheet/
MIT License
7.13k stars 779 forks source link

[v4] BottomSheetModal Portal not working #1905

Closed alexborton closed 2 months ago

alexborton commented 4 months ago

Bug

We have a setup that is using BottomSheet where BottomSheetModal is better suited. However, the Portal setup does not work with BottomSheetModal - it does however work correctly with BottomSheet.

Quick example of setup;

// BottomSheetComponent.tsx

const Port = ({ children }) => (
  <Portal hostName="authenticated">{children}</Portal> // Portal "authenticated" is defined in our Authenticated stack to make sure Modals (from React Navigation) can take priority over BottomSheet/BottomSheetModal
)

...

return (
<Port>
      <BottomSheet
        ref={bottomSheetRef}
        index={-1}
        enableDynamicSizing
        backdropComponent={renderBackdrop}
        onChange={handleChange}
        snapPoints={snapPoints}
      >
      ....
      </BottomSheet>
</Port>      
)

Using BottomSheetModal means we don't have to have the snap points, otherwise they seem to be required and the bottom sheet isn't properly dismissible.

With this example, if we switch out BottomSheet for BottomSheetModal, the Portal does not have the desired effect.

Environment info

Library Version
@gorhom/bottom-sheet 4.6.4
react-native 0.73.6
react-native-reanimated 3.8.1
react-native-gesture-handler 2.14.1

Steps To Reproduce

1. 2.

Describe what you expected to happen:

1. 2.

Reproducible sample code

github-actions[bot] commented 3 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.

github-actions[bot] commented 2 months ago

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

alexborton commented 2 months ago

Bumping this up to be looked at