As in title: when initializing Picker component in Android with prop 'value' equals to value of first option, the odd onValueChange triggers. If prop 'value' equals to any other options value, everything is ok. iOS is ok.
RNPlay: https://rnplay.org/apps/DqxK9g
+1 having the same issue
+1
I made a workaround, that looks like this
const weHaveAVersionWithThisBug = !!'https://github.com/facebook/react-native/issues/9220';
const workAround = value => { if (value!==selectedValue) onChange(value); };
const onValueChange = weHaveAVersionWithThisBug ? workAround : onChange;
return (
<Picker
selectedValue={ selectedValue }
onValueChange={ onValueChange }
>
works for me now, and I know why this crap is in there :)
Looks like this commit
https://github.com/facebook/react-native/commit/a2a8d7f5da93ee10cf5eccfb944f581f43cfe0c0 could fix the problem (as it described in release notes) but I haven't checked yet.
+1 I would be thankful if this one got fixed. I had to use rather ugly workaround due to the way this interacted with other systems we use on frontend.
I guess this is related.
Looks like issue is still relevant.
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
Most helpful comment
I guess this is related.
Looks like issue is still relevant.