React-native-reanimated-bottom-sheet: Bottom sheet snap too high causing back layout exposed at bottom

Created on 13 Oct 2019  路  5Comments  路  Source: osdnk/react-native-reanimated-bottom-sheet

I'm not sure if I am doing this correctly, but my bottom sheet is always snapped too high when opened, resulting in the bottom part being exposed to my main layout. Is it because of safeareaview? I tried changing snapPoints[0] to a fixed number, adjusting the height, adding margins to renderInner View but it doesn't work.

renderInner = () => (
          <View style = {{
              backgroundColor: '#fff000',
              height: '100%',
          }}>
              <Text>Copy</Text>
          </View>
      )

<SafeAreaView>
<MyMainContent />
 <BottomSheet
                    ref={this.bs}
                    snapPoints = {['100%', '0%']}
                    initialSnap={1}
                    renderContent = {this.renderInner}
                />
</SafeAreaView>

IMG_0287

Most helpful comment

I solved this by placing the BottomSheet outside of the SafeAreaView

All 5 comments

You could "solve" problem for now by just setting overdragResistanceFactor to 0 :)
It's not ideal, but will solve an issue.

I had the same problem. I worked around by setting the bottom position to 0 (in line with the bottom of the screen) and setting the closed snap point to the amount I wanted the bottom sheet to be visible. Having bottom or marginBottom to offset the sheet causes this issue.

I also had this problem when the top most container View had padding. When I removed the padding (even just paddingTop), the bottomSheet aligned with the bottom of the screen.

I solved this by placing the BottomSheet outside of the SafeAreaView

As @mnjongerius said, placing the BottomSheet outside of the SafeAreaView solves the problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

obetomuniz picture obetomuniz  路  5Comments

sebqq picture sebqq  路  4Comments

EricPKerr picture EricPKerr  路  5Comments

lukebars picture lukebars  路  5Comments

Saad-Bashar picture Saad-Bashar  路  6Comments