File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed
android/src/main/java/com/reactnative/wheelpicker Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ public void setSelectedItem(int index) {
51
51
selectedIndex = index ;
52
52
if (items .size () > index ) {
53
53
wheelView .setCurrentItem (index );
54
- setContentDescription (wheelView .getContentText (getItem (index )));
55
54
}
56
55
}
57
56
@@ -93,7 +92,6 @@ public int indexOf(Object o) {
93
92
@ Override
94
93
public void onItemSelected (int index ) {
95
94
if (getItemsCount () > index ) {
96
- setContentDescription (wheelView .getContentText (getItem (index )));
97
95
WritableMap event = Arguments .createMap ();
98
96
event .putInt ("selectedIndex" , index );
99
97
ReactContext reactContext = (ReactContext ) getContext ();
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @sdcx/wheel-picker" ,
3
3
"description" : " A React Native Wheel Picker ui component." ,
4
- "version" : " 0.11 .0" ,
4
+ "version" : " 0.13 .0" ,
5
5
"main" : " ./dist/index.js" ,
6
6
"typings" : " ./dist/index.d.ts" ,
7
7
"react-native" : " src/index" ,
Original file line number Diff line number Diff line change @@ -27,23 +27,24 @@ interface Event {
27
27
} ;
28
28
}
29
29
30
- interface WheelPickerProps < T > {
31
- testID ?: string ;
30
+ interface WheelPickerProps < T > extends ViewProps {
32
31
onValueChange ?: ( value : T , index : number ) => void ;
33
32
selectedValue : T ;
34
33
items : PickerItem < T > [ ] ;
35
34
style ?: StyleProp < TextStyle > ;
36
35
itemStyle ?: StyleProp < TextStyle > ;
37
36
}
38
37
39
- function WheelPicker < T > ( {
40
- testID,
41
- selectedValue,
42
- onValueChange,
43
- items = [ ] ,
44
- style,
45
- itemStyle = { } ,
46
- } : WheelPickerProps < T > ) {
38
+ function WheelPicker < T > ( props : WheelPickerProps < T > ) {
39
+ const {
40
+ selectedValue,
41
+ onValueChange,
42
+ items = [ ] ,
43
+ itemStyle = { } ,
44
+ style,
45
+ ...rest
46
+ } = props ;
47
+
47
48
const handleItemSelected = useCallback (
48
49
( event : Event ) => {
49
50
const selectedIndex = event . nativeEvent . selectedIndex ;
@@ -75,7 +76,7 @@ function WheelPicker<T>({
75
76
76
77
return (
77
78
< WheelPickerNative
78
- testID = { testID }
79
+ { ... rest }
79
80
style = { [ { height} , _style ] }
80
81
onItemSelected = { handleItemSelected }
81
82
selectedIndex = { selectedIndex === - 1 ? 0 : selectedIndex }
You can’t perform that action at this time.
0 commit comments