react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

[v5] | [v2] unable to call `snapToIndex`

Open mojjominion opened this issue 1 year ago • 3 comments

Bug

Environment info

Library Version
@gorhom/bottom-sheet 5.0.0-alpha.10
react-native 0.74.3
react-native-reanimated 3.14.0
react-native-gesture-handler 2.17.1

Steps To Reproduce

  1. Setup BottomSheet component
  2. Try calling snapToIndex

Describe what you expected to happen:

  1. It should not throw the error 'index' was provided but out of the provided snap points range! expected value to be between -1, 0

Reproducible sample code

https://snack.expo.dev/@mohan1o1/brave-green-milkshake?platform=android

mojjominion avatar Jul 28 '24 10:07 mojjominion

you need to disable the enableDynamicSizing , since you did not wrap you bottom sheet content with BottomSheetView

gorhom avatar Jul 28 '24 20:07 gorhom

Thanks for letting me know. Making enableDynamicSizing: false works fine.

Couldn't get why it's not working without explicitly setting it false though since the default value is false here

mojjominion avatar Jul 29 '24 07:07 mojjominion

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.

github-actions[bot] avatar Aug 28 '24 09:08 github-actions[bot]

Thanks for letting me know. Making enableDynamicSizing: false works fine.

Couldn't get why it's not working without explicitly setting it false though since the default value is false here

Same issues here. It works fine after add enableDynamicSizing={false}, but don't understand why the document's @default false doesn't work.

yyyyyyounger avatar Oct 09 '24 03:10 yyyyyyounger