Skip to content

Commit 8602bf3

Browse files
author
alvaromb
committed
Fixed closing selection problem
1 parent 8fb0ae3 commit 8602bf3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 InterfaceKit
3+
Copyright (c) 2018 APSL
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ import CascadePicker from 'react-native-js-cascade-picker'
2525
<CascadePicker
2626
options={[{ value: 2, label: 'Two' }, { value: 4, label: 'Four' }]}
2727
valueSelected={this.state.val}
28-
onChange={(option: Object) => this.setState({ val: option.value })}
28+
onChange={(option: ?Object) => {
29+
if (option) {
30+
this.setState({ val: option.value })
31+
}
32+
}}
2933
pickerText='Select one'
3034
/>
3135
```

lib/MainOptionButton.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,18 @@ class MainOptionButton extends React.PureComponent<Props> {
4949
}
5050
}
5151

52+
_onPressMainButton = () => {
53+
this.props.onPress()
54+
}
55+
5256
render() {
5357
const rotate = this._anim.interpolate({
5458
inputRange: [0, 100],
5559
outputRange: ['0deg', '180deg']
5660
})
5761
return (
5862
<TouchableElement
59-
onPress={this.props.onPress}
63+
onPress={this._onPressMainButton}
6064
style={[this.props.style, styles.container]}>
6165
<View style={styles.textContainer}>
6266
<Text style={[styles.text, this.props.textStyle]}>

0 commit comments

Comments
 (0)