erksch / react-native-wheely

An all JavaScript wheel picker for react-native without any native code.
432 stars 60 forks source link

ScrollToEvents #15

Closed Lucienzera closed 2 years ago

Lucienzera commented 3 years ago

Is there away to surface the scrollToIndex events since the elements are using flatlist to handle index snap to specific index based on onPressed?

erksch commented 3 years ago

Good idea, we could add a prop and pass it through or allow setting props of the FlatList in general.

Lucienzera commented 3 years ago

Thanks for replying so soon, Could you suggest an approach I should take in order to try and do this and play around with it while waiting for you?

I was thinking of ref and allowing user to apply ref to the wheel picker and access the flatlist internal function. But no success so far

erksch commented 2 years ago

Since 0.5.0, you can now add props to the FlatList using flatListProps. The picker also jumps to the selected index if the value is changed from outside.