File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/components/TimePicker/wheel-picker Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-ui-datepicker" ,
3- "version" : " 2.0.5 " ,
3+ "version" : " 2.0.6 " ,
44 "description" : " Customizable date picker for React Native" ,
55 "main" : " lib/commonjs/index" ,
66 "module" : " lib/module/index" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 ViewProps ,
1111 FlatListProps ,
1212 FlatList ,
13+ Platform ,
1314} from 'react-native' ;
1415import styles from './wheel-picker.style' ;
1516import WheelPickerItem from './wheel-picker-item' ;
@@ -109,8 +110,9 @@ const WheelPicker: React.FC<Props> = ({
109110 * This ensures that what the user sees as selected in the picker always corresponds to the value state.
110111 */
111112 useEffect ( ( ) => {
112- flatListRef . current ?. scrollToOffset ( {
113- offset : selectedIndex * itemHeight ,
113+ flatListRef . current ?. scrollToIndex ( {
114+ index : selectedIndex ,
115+ animated : Platform . OS === 'ios' ,
114116 } ) ;
115117 } , [ selectedIndex , itemHeight ] ) ;
116118
You can’t perform that action at this time.
0 commit comments