Skip to content

Conversation

@DanielMaly
Copy link

No description provided.

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