react-native-select-picker
react-native-select-picker copied to clipboard
Issue when parsing value={null}
When having an<SelectPicker.Item
with the value null
and and parsing a value 0
as value in one of the other fields the Item with the null value is being selected
<SelectPicker
selected={0}
>
<SelectPicker.Item label="Select none" value={null} /> /* THIS WILL VE SELECTED */
<SelectPicker.Item label="option #1" value={0} />
<SelectPicker.Item label="option #2" value={1} />
<SelectPicker.Item label="option #3" value={2} />
</SelectPicker>
Expected behaviour
When parsing any as selected
the Item with the value matching the value of selected should be picked.
Eg:
- parsing
selected={0}
should select the item with thevalue={0}
- parsing
selected={1}
should select the item with thevalue={1}
- parsing
selected={null}
should select the item with thevalue={null}
As a temporary solution i moved the Select none
to the bottom of the list
Thanks for the notice. Did you try it with any other value? Did it work?