react-native-smooth-picker
react-native-smooth-picker copied to clipboard
initialScrollToIndex behaving in a weird way
I'm having a problem with initialScrollToIndex method, so when my component renders the list should immediately scroll to a certain given index, i was passing that through redux. the behavior i'm getting is that when the component mounts the initialScrollToIndex sometimes works sometimes it doesn't. first i thought its from redux so i simply gave it a static index of 10, though the unstable behavior remains. sometimes it moves sometimes no.
<SmoothPicker offsetSelection={0} initialScrollToIndex={initialIndex} magnet // scrollAnimation horizontal data={result} activeOpacityButton={0} keyExtractor={( index) => index.toString()} onSelected={({ item, index }) => this.handleChange(item, index)} renderItem={({item,index}) => this.renderScrollItem(item,index)} />