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

Bug: if props are updated except selectedValue, Picker's selectedValue will have the value of first Picker.Item. #210

Open
wonism opened this issue Feb 24, 2020 · 0 comments

Comments

@wonism
Copy link

wonism commented Feb 24, 2020

{/* if component props will be changed like below. */}

<Picker
  defaultSelectedValue={0}
  selectedValue={someAwaitingValue /* it is undefined yet. */}
>
  {items}
</Picker>

{/* vvvvvvvvvv */}

<Picker
  defaultSelectedValue={1}
  selectedValue={someAwaitingValue /* it is undefined yet. */}
>
  {items}
</Picker>

The condition for updating this.state.selectedValue is currently 'selectedValue' in nextProps.
This causes select method will update the selectedValue to be the first value of Picker.Item.

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

No branches or pull requests

1 participant