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.

[v4] BottomSheetModal: Backdrop appears but Modal Content is not visible.

See original GitHub issue

Bug

Very occasionally when calling present on a BottomSheetModal the backdrop will appear but the modal content will not be visible.

Oddly the content of the modal is still interact-able (i.e button presses get recorded) so the content is rendered, its just not visible (opacity: 0?).

This is very erratic, in that sometimes it happens first time, others it takes 5 or 10 trys dismissing and opening for it to occur. I have got it occurring in the snack below and have attached a screenshot to show.

I’m not ruling out us doing something wrong here and that snack is obviously a very reduced case but represents the broad use case. Primarily:

  • present() called on button press
  • rendered inside react navigation stack
  • BottomSheetFlatlist is inside the modal.

Just looking for pointers if we’re doing something wrong and happy to help investigate and provide whatever information may be useful.

Environment info

{ “dependencies”: { “@gorhom/bottom-sheet”: “^4.1.3”, “react-native-screens”: “~3.4.0”, “@react-navigation/stack”: “^6.0.9”, “react-native-reanimated”: “~2.2.0”, “@react-navigation/native”: “^6.0.4”, “react-native-gesture-handler”: “~1.10.2”, “react-native-safe-area-context”: “3.2.0” } }

Steps To Reproduce

  1. Tap ‘Open model’
  2. Dismiss modal
  3. Repeat open and close until eventually modal content doesn’t appear.

Describe what you expected to happen:

  1. Modal content reliably appears.

Reproducible sample code

Reminder that this doesn’t happen straight away, can take 5 / 10 / 20 tries. Speed does not seem to matter though.

In addition we’ve only seemed to get this issue on iOS, not saying that it couldn’t happen on Android only we haven’t seen it yet.

https://snack.expo.dev/@ryanhyslop/bottom-sheet-v4-reproducible-issue-template

IMG_2D42F22F3585-1

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
AlexBHarleycommented, Jan 3, 2022

We’re also running into this on v4.1.5

5reactions
He1nr1chKcommented, Jan 1, 2022

@gorhom I am using v4.1.5 but this still happens when the component rerenders. The content appears normally but as soon as the state changes and a rerender is triggered the content disappears but the backdrop remains.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[v4] Bottom Sheet Backdrop not showing up #600 - GitHub
Bug The backdrop doesn't show up in the latest build. ... Note: I changed bottom sheet to BottomSheetModal because that is what I'm...
Read more >
Bootstrap modal appearing under background - Stack Overflow
However, my modal is appearing underneath the grey fade (backdrop) and is non editable. Here's what it looks like: modal hiding behind backdrop....
Read more >
Props | React Native Bottom Sheet - GitHub Pages
Component to be placed as a sheet backdrop, by default is set to null , however the library also provide a default implementation...
Read more >
Bootstrap Modal Dialog showing under Modal Background
The problem occurs because the overlay and the other content container are not relative to each other so the position:absolute (or fixed) and ......
Read more >
showModalBottomSheet function - material library - Dart API
This example demonstrates how to use showModalBottomSheet to display a bottom sheet that obscures the content behind it when a user taps a...
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