Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DanielMaly
Copy link

No description provided.

@@ -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)
Copy link
Contributor

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?

Copy link
Author

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"
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants