react-native-select-picker icon indicating copy to clipboard operation
react-native-select-picker copied to clipboard

Issue for value equal to 0

Open jota12x opened this issue 4 years ago • 0 comments

I don't know if this is some implementation detail but when having a <SelectPicker> with default value selected equal to zero, the corresponding item is not automatically selected. This is not happening for other values.

<SelectPicker
    selected={0}
>
    <SelectPicker.Item label="option #1" value={0} /> // It is not being selected automatically 
    <SelectPicker.Item label="option #2" value={1} />
    <SelectPicker.Item label="option #3" value={2} />
</SelectPicker>

Expected behavior

When it is set to zero, it should select the corresponding item

Notes

My solution for now is to use selected with a default value being a string and for some reason that works.

jota12x avatar Nov 05 '20 08:11 jota12x