Picker has an enabled prop that enables/disables the picker behaviour. We should extend this prop to both Select and DatePicker components.
In the case of Select, the prop disables the picker but not the Touchable component that wraps it, leaving a very strange behaviour where you can open the picker but not scroll through it.
Hello,
I just came across the issue that I wanted to show a Select and DatePicker component at first disabled w/ default / previously stored value. When clicking on a button both should get editable again.
Solved this by adding the disabled prop to TouchableOpacity in the CollapsiblePickerIOS and CollapsibleDatePickerIOS template, like so :
<TouchableOpacity
style={touchableStyle}
disabled={!locals.enabled}
onPress={...}
>
<Text style={dateValueStyle}>
{formattedValue}
</Text>
</TouchableOpacity>
As CollapsibleDatePickerIOS has no enabled prop by itself, I had to temporarily make an own factory and add it to the locals. Maybe you can add it by default to CollapsibleDatePickerIOS.
I hope that my thoughts are right and maybe this fits your issue.
@VLNTNA
It doesn't work when we open the Select and some callback change enabled to false in props. The state doesn't change and the opened select list is opened.
We need to check states in componentWillReceiveProps and close the Select.