[v4] BottomSheetBackdrop - appearsOnIndex of 0 fails to render backdrop (has workaround)
See original GitHub issueBug
- I’m willing to provide a pull request for this issue
As of 4.1.5
, the BottomSheetBackdrop
does not support a value of appearsOnIndex={0}
. The root cause seems to be coercion to a default of 1
from a falsey 0
value.
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | 4.1.5 |
react-native | 0.64.3 |
react-native-reanimated | 2.2.4 |
react-native-gesture-handler | 1.10.3 |
Steps To Reproduce
- Create a bottom sheet with a custom backdrop using the
renderBackdrop
from the example - Provide the properties
appearsOnIndex={0}
anddisappearsOnIndex={0}
Describe what you expected to happen:
- The backdrop should be visible on index
0
Workaround Providing a snapIndex
such as snapIndex={[1, "40%"]}
will work although technically the modal will be visible at the bottom of the screen. Alternatively, you can copy/paste the BottomSheetBackdrop
into a new component with either new defaults or fixed coercion.
Reproducible sample code
Reproducible Snack: https://snack.expo.dev/@jakobo/bottomsheetbackdrop---appearsonindex-bug
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:5 (2 by maintainers)
Top Results From Across the Web
expo - React Native bottom sheet opens when TextInput has ...
Found a fix for the problem, it looks like it had to do with the keyboard and expo. I noticed that when the...
Read more >BottomSheetBackdrop | React Native Bottom Sheet
BottomSheetBackdrop. A pre-built BottomSheet backdrop implementation with configurable props. Props. Inherits ViewProps from react-native . animatedIndex .
Read more >react-native-bottom-sheet - bytemeta
[v4] BottomSheetBackdrop - appearsOnIndex of 0 fails to render backdrop (has workaround) · [v4] BottomSheetTextInput not draggable on Android · [v4. · [v4]...
Read more >no-progress-bar to disable printing "Remaining time until next ...
[v4] BottomSheetBackdrop - appearsOnIndex of 0 fails to render backdrop (has workaround), 5, 2021-12-16 ; [css-anchor-1] Issues with position fallback, 3, 2022- ...
Read more >[v4] Backdrops not displaying - react-native-bottom-sheet - GitAnswer
Backdrop components do not display unless you have 2 or more snapPoints ... props => <BottomSheetBackdrop disappearsOnIndex={-1} appearsOnIndex={0} ...
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
You could write a custom backdrop component until the PR merged
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.