question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bottom Sheet Modal overlay not working when using one snap point

See original GitHub issue

Bug

Hello,

I use Bottom Sheet Modal, and want to use one Snap Point, it works but I dont get an overlay, if I use 2 snapPoints then its work. How can I fix it ?

Environment info

Library Version
@gorhom/bottom-sheet x.x.x
expo 45.0
react-native-reanimated 2.9.1
react-native-gesture-handler 2.2.1

Steps To Reproduce

Reproducible sample code

const snapPoints = useMemo(() => ['75%'], []);
....
  return (
    <BottomSheetModal
      ref={ref}         
      index={0}
      snapPoints={snapPoints}
      handleIndicatorStyle={s.handleStyle}
      onChange={handleChange}
      backdropComponent={BottomSheetBackdrop}
    >
      {
        renderTabBar
      }
      { datas && datas.length > 0 ? (
        <BottomSheetFlatList
          data={datas}
          renderItem={renderItem}
          keyExtractor={(item, i) => i.toString()}
          initialNumToRender={10}
          windowSize={8}
          maxToRenderPerBatch={50}
          updateCellsBatchingPeriod={50}
          contentContainerStyle={s.flatlistContent}
        />
        )
        :
        null
      }
    </BottomSheetModal>
  )

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

5reactions
ewalcommented, Aug 25, 2022

Leaving a comment here if anyone looking for a solution. Both disappearsOnIndex and appearsOnIndex must be set:

<BottomSheetBackdrop {...props} disappearsOnIndex={-1} appearsOnIndex={0} />
0reactions
github-actions[bot]commented, Aug 17, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Props | React Native Bottom Sheet - GitHub Pages
Points for the bottom sheet to snap to, points should be sorted from bottom to top. It accepts array of number, string or...
Read more >
Sheets: bottom - Material Design
STATE_COLLAPSED: The bottom sheet is visible but only showing its peek height. This state is usually the 'resting position' of a bottom sheet,...
Read more >
@milosj/react-modal-sheet - npm
Start using @milosj/react-modal-sheet in your project by running `npm ... when the sheet is opened/closed or when it snaps to a snap point....
Read more >
N1k1tk-react-spring-bottom-sheet NPM | npm.io
A more elaborate example that showcases how snap points work. It also shows how it behaves if you want it to be open...
Read more >
Creating and styling a modal bottom sheet in React Native
In this tutorial, we'll create a basic application with a modal bottom sheet feature. We'll set up the app, fetch data, and style...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found