react-native-material-dropdown
react-native-material-dropdown copied to clipboard
Disable individual drop down item
I see in the documentation that there is the disabledItemColor prop, but how do you disable an individual drop down item?
I am also facing the same issue, referred to the example which is using props: { disabled: true } property but after using the same also, disabledItemColor not working at all.
I have used a trick to do that which is: <Text style={{ color: disabled? 'grey' : 'black' }}></Text> but it will show [object object] after selecting that item because you will select an element here not the text.
Hence there no way to stop selecting a disable item here.
I am also facing same issue. How we can disable an item in dropdown.
Anyone able to successfully disable individual drop down item? I can't get it to work. i tried using propsExtractor but the props value only return undefined. Please help
I am also facing the same issue. Plz help
You can disable individual items using propsExtractor. For instance I used this method to disable items with a falsy value.
propsExtractor={item => { if (!item.value) { return { disabled: true }; } else { return {}; } }}
The above works to disable items. However if you are looking to scroll, the disabled items don't respond to dragging.