adammcarth / react-native-segmented-picker

Selection picker wheel with multi-column support and optional native dependencies.
MIT License
96 stars 31 forks source link

how to open picker with desired value? #62

Closed creativemind1 closed 2 years ago

creativemind1 commented 2 years ago

I'm opening picker with Ref.current.show() I want my picker to scroll to the value I want. How can I do this?

adammcarth commented 2 years ago

There's a prop called defaultSelections where you can pass in an object with the key of a column mapped to a value that you want automatically selected when the picker opens. Note that it won't animate/visibly scroll to the default selection, however. It will snap to it without an animation.

creativemind1 commented 2 years ago

Thanks