-
-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: BottomSheetModal does not open on mount, breaks when -1
index is provided
#2126
Comments
your code is wrong. no ref are passed to modal |
... 🤦 😂 thank you @alainib Have just passed ref through, and I can still reproduce the issue. When there is a no index assigned, the Modal should be opening on mount, so at least the existing code was reproducing that I'll update the expo link with the ref |
Playing with it more and I've started to see where it begins to break. I'll update the issue to reflect the specific situations where it no longer opens |
-1
index is provided
Ok I've completed some additional debugging and have updated the issue description to reflect my findings.
|
This commit seems sus e4f3fe3 |
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
iOS, Android, Web
What happened?
BottomSheetModal
is currently quite flaky, and depending on what props you provide it may cause the modal to break and not displayusing Expo v52 and the following dependencies:
1. Minimum working example
https://snack.expo.dev/Id-3-P3lv3kICp-QOawgl describes the minimum working example required for the modal to present. (no props specified other than a
ref
for control)2. Dynamic sizing example
A few people mentioned in #2035 (comment) that setting
enableDynamicSizing={false}
would fix the issue for them.However, this example https://snack.expo.dev/CTsdX7kXPEbA4CGE9QAO shows that setting it to true works as expected
Though as above the modal does not open immediately on mount.
3. Snap points example
https://snack.expo.dev/Gv_7H75wCgzeJfKJRP4CO this time we specify
snapPoints
and anindex
:Snap points work as expected, however as above the modal does not open immediately on mount.
4. Negative index example
As per docs, setting the index to
-1
will initiate the modal in a closed statereact-native-bottom-sheet/src/components/bottomSheet/types.d.ts
Lines 32 to 37 in 7bfe7ae
This example sets the index to
-1
https://snack.expo.dev/Jk96UeB34dS58J_YkjFQ8ref
ref
(it appears to break)Although initial state of the modal matches expectations, it could be a catalyst to the issues in (1) (2) and (3)
Reproduction steps
package.json
:Reproduction sample
https://snack.expo.dev/Jk96UeB34dS58J_YkjFQ8
Relevant log output
The text was updated successfully, but these errors were encountered: