Skip to content

[v5-alpha] Web - animatedIndex changes by itself and causes the BottomSheet to open up on navigating back to it #1910

Open
@5ZYSZ3K

Description

@5ZYSZ3K

Bug

On web, when your BottomSheet did render, and then you navigated away from it, the _animatedContainerHeight property is set to 0. It causes animatedIndex variable to be 0 - and so, when you navigate back to the screen with the BottomSheet, it opens up immediately.

Environment info

Library Version
@gorhom/bottom-sheet 5.0.0-alpha.11
react-native 0.74.3
react-native-reanimated 3.10.1
react-native-gesture-handler 2.16.1

Steps To Reproduce

  1. Open up an app on web
  2. Navigate to the screen with BottomSheet
  3. Navigate away from it
  4. Navigate back to it - BottomSheet will pop up immediately (animatedIndex changed to 0)

Reproducible sample code

Here is a demo repo:
https://github.com/5ZYSZ3K/bottom-sheet-web-issue-demo
On web, navigate away from the screen with BottomSheet, and then back to it - it will pop up immediately

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv5

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions