Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onItemChange returns empty strings for value and label #97

Open
t3db0t opened this issue Sep 13, 2024 · 2 comments
Open

onItemChange returns empty strings for value and label #97

t3db0t opened this issue Sep 13, 2024 · 2 comments

Comments

@t3db0t
Copy link

t3db0t commented Sep 13, 2024

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
Copy link
Author

t3db0t commented Sep 13, 2024

OK, I figured out what's causing this. react-native-picker has a change (react-native-picker/picker#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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants