react-native-woodpicker
react-native-woodpicker copied to clipboard
Can't select first item on Android when isNullable={false}
When on Android and using the <Picker/> component, if the isNullable
prop is set to false
or left as default, when the user selects the first item in the list, it doesn't trigger the onItemChange function and the value stays as the placeholder.
If you select any other item, the picker behaves correctly. Once you've done this, you can select the first item and the picker again behaves correctly.
Hello,
Sorry for this late answer. Could you describe a repro?
when you mount the picker, the item
props is the first element of the items
props array?
Hello, I currently have this issue as well. the onItemChange does not fire when you select the first item in your defined list.
Ok, just found the cause. It's a bad behavior. if "isNullable" is false and item prop is null => the first element of the list is selected but there is an issue with the placeholder not showing the label.
I'm going to fix the placeholder.
Hello, it should be good on 0.3.13 =)
@thodubois I still have this problem.
@maiconcosta Hello could you explain your behavior and give your package version and repro =)
@thodubois , I am having the same issue too, even in the latest version 0.3.17, here is the example code I am using in my project.
<Picker
item={{label: "", value: ""}}
items={[
{label: "a", value: "a"},
// {label: "b", value: "b"},
]}
placeholder={"Please Select"}
onItemChange={(value) => {
// wont trigger when items have only one object
console.log(value);
}}
isNullable={false}
/>
Hi, I'll take a look asap =)
Tengo el mismo problema en 0.3.17
No puedo seleccionar el primer item del picker, cuando selecciono el segundo item y despues el primero ahi si funciona perfectamente alguna ayuda con eso 0.3.17
same issue here, on 0.3.17
Any update here? I am having the same issue. I have to select the 2nd item and then come back to the first one in order for the form to pick up the first item value.
I am on ios.