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] Initial index -1 not working on Android Only

See original GitHub issue

Bug

When using the -1 index to make sure that the sheet is closed on the initial render, the sheet works fine on IOS but not on android. Instead on android, the sheet renders a small portion at the bottom of the screen, which blocks interaction with contents outside the sheet.

WhatsApp Image 2021-09-15 at 11 08 55 PM

Environment info

Library Version
@gorhom/bottom-sheet 4.0.3
react-native 0.63
react-native-reanimated 2.2.0
react-native-gesture-handler 1.10.3

Steps To Reproduce

Nothing big here, a simple example. Just set the index to -1.

Describe what you expected to happen:

The sheet should be closed on initial render and only show when a button is pressed

Reproducible sample code

The snack code with the issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
aditya-keri-betterhalfcommented, Sep 22, 2021

@gorhom - I am experiencing the same issue on a Physical device. Any help is greatly appreciated!

1reaction
aimensasicommented, Sep 22, 2021

I am not sure that would help but will try and let you know.

Currently, my workaround is to do the following

useEffect(() => {
  	sleep(400).then(() => {
		  sheet.current?.close();
	  });
  }, []);

This will cause the sheet to close, but only after a certain amount of mseconds.

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 reasons your z-index isn't working (and how to fix it)
Let's check out the first reason: 1. Elements in the same stacking context will display in order of appearance ...
Read more >
Why does z-index not work? - Stack Overflow
The z-index property only works on elements with a position value other than static (e.g. position: absolute; , position: relative; , or position:...
Read more >
Known issues with Android Studio and Android Gradle Plugin
This page tracks known issues with Android Studio Dolphin | 2021.3.1 and Android Gradle plugin ... Android Studio doesn't start after installing version...
Read more >
z-index - CSS: Cascading Style Sheets - MDN Web Docs
The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger ...
Read more >
Mobile-first Indexing Best Practices | Google Search Central
Discover what Google mobile-first indexing is and explore best practices designed to improve user experience in Google Search.
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