Skip to content

Commit be4f99a

Browse files
committed
compatible PickerIOS's onValueChange
1 parent a5a7bda commit be4f99a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,11 @@ export default class PickerAndroid extends React.Component{
173173
}
174174

175175
_onValueChange(){
176-
//the current picked label was more expected to be passed
176+
//the current picked label was more expected to be passed,
177+
//but PickerIOS only passed value, so we set label to be the second argument
177178
//add by zooble @2015-12-10
178179
var curItem = this.state.items[this.index];
179-
this.props.onValueChange && this.props.onValueChange(curItem.label, curItem.value, this.index);
180+
this.props.onValueChange && this.props.onValueChange(curItem.value, curItem.label);
180181
}
181182

182183
render(){

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-picker-android",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "react-native-picker-android",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)