Skip to content

Commit 078e386

Browse files
Eddie Duganfacebook-github-bot
Eddie Dugan
authored andcommitted
fix setNativeSelectedPosition native command
Summary: telling native that `selected` is the new selection is basically ignoring the most recent user input and resetting it back to the previous value. the reason it flips back and forth is that by the next time `onSelect` is called, the above code has updated the value of `selected` (line 63) Changelog: [Android] [Fixed] Picker - fix usage of setNativeSelectedPosition in onSelect Reviewed By: mdvacca Differential Revision: D22022456 fbshipit-source-id: fe51f9cbd712b5578e9fd9ea2992bd12d48f4ec4
1 parent 8dce59c commit 078e386

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/Components/Picker/PickerAndroid.android.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function PickerAndroid(props: Props): React.Node {
100100
props.mode === 'dropdown'
101101
? AndroidDropdownPickerCommands
102102
: AndroidDialogPickerCommands;
103-
Commands.setNativeSelectedPosition(current, selected);
103+
Commands.setNativeSelectedPosition(current, position);
104104
}
105105
},
106106
[

0 commit comments

Comments
 (0)