thodubois / react-native-woodpicker

Customisable picker and datePicker react-native components for Android and iOS.
MIT License
160 stars 22 forks source link

onItemChange returns empty strings for value and label #97

Open t3db0t opened 2 months ago

t3db0t commented 2 months ago

I know this package hasn't been touched in 3 years, but I am using it for a project. I was using @react-native-picker/picker v.2.4.0 successfully but was forced to update to v.2.7.5 in order to support other updates. I'm not positive that this update is the cause, but now when I try to select an item with Picker it only returns empty strings for the value and label fields. I've been hunting through the @react-native-picker/picker code and issues but I don't see anything that would cause this.

Anyone experience this or have any ideas?

t3db0t commented 2 months ago

OK, I figured out what's causing this. react-native-picker has a change (https://github.com/react-native-picker/picker/issues/538) where value only returns as a string, so my integer values weren't being found in the nullableItems list. All I had to do is change my own values to strings to match.

I'm not sure if this necessarily warrants a change to this package; I do see that the PickerItem type lists value as any so technically this might need to be changed to string...

thodubois commented 2 months ago

Hi @t3db0t, Thanks for your time. I'll try to update this package soon. =)