mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fixing RN Picker
Summary: Changelog: [Internal] Fixing a red screen on the RN picker. Looks like the picker gets confused when for unknown reasons a native value is undefined. In that case we stick to the JS value as it is specified in the comment. https://fb.workplace.com/groups/rn.support/permalink/2997783536936908/ NOTE : Native fix was landed, this add an extra layer on the JS side Reviewed By: mmmulani Differential Revision: D18443005 fbshipit-source-id: 9511ac90f2d9e6186c6c0de3b673cc535cdb9fa6
This commit is contained in:
committed by
Facebook Github Bot
parent
9c5b26639a
commit
a7233e45a4
@@ -115,7 +115,11 @@ class PickerIOS extends React.Component<Props, State> {
|
||||
// This is necessary in case native updates the picker and JS decides
|
||||
// that the update should be ignored and we should stick with the value
|
||||
// that we have in JS.
|
||||
if (this._picker && this._lastNativeValue !== this.state.selectedIndex) {
|
||||
if (
|
||||
this._picker &&
|
||||
this._lastNativeValue !== undefined &&
|
||||
this._lastNativeValue !== this.state.selectedIndex
|
||||
) {
|
||||
PickerCommands.setNativeSelectedIndex(
|
||||
this._picker,
|
||||
this.state.selectedIndex,
|
||||
|
||||
Reference in New Issue
Block a user