-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed to work under new versions React Native (tested on 0.38) #1
base: master
Are you sure you want to change the base?
Conversation
@@ -28,9 +28,6 @@ class NumberPicker extends Component { | |||
if (this.props.onSelect) | |||
this.props.onSelect(event.nativeEvent.value); | |||
|
|||
if (this.refs[REF_PICKER] && this.state.selectedIndex !== event.nativeEvent.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to set the default value, does it not work in later versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It forces the client to update the selectedIndex prop every time an "onSelect" event is received, which, while logical, may not be immediately apparent (adding it to the README would fix that).
But the bigger problem when I was testing was that setting the selectedIndex prop on the element couldn't keep up with the native events that kept resetting the picker to it's original value thanks to these two lines. The whole thing then became unusable. I'm open to any ideas on how to fix that.
"description": "React Native Android NumberPicker", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/fixd/react-native-numberpicker.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to undo this and the author change
No description provided.