AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
320 stars 137 forks source link

Unable to set default value as first value of array in data props #54

Closed bingchuan93 closed 2 years ago

bingchuan93 commented 2 years ago

Hihi! Im unable to set the first value in the array in data props if the first value is 0.

Eg. [0, 5, 10], i cant set defaultValue={0} nor defaultValueByIndex={0} to let default value be the value '0' Doing this will revert the box value to the placeholder instead of '0'

tia

AdelRedaa97 commented 2 years ago

Which version do you use?

bingchuan93 commented 2 years ago

I'm using 1.11.0. @AdelRedaa97

AdelRedaa97 commented 2 years ago

I have made some changes, Could you try v"1.12.0" and tell me if it still not working

bingchuan93 commented 2 years ago

Hi @AdelRedaa97 !

Its still not working. I'm guessing its because selectedItem is 0 and reverts to the falsey part of the ternary operator when rendering.

image
AdelRedaa97 commented 2 years ago

Thanks for reporting ❤️ it's fixed now in v"1.13.0" let me know if it still not working

bingchuan93 commented 2 years ago

Yes it works now! thanks much!