mxck / react-native-material-menu

Pure JavaScript material menu component for React Native
MIT License
512 stars 91 forks source link

color attribute of textStyle takes precedence over disabledTextColor #119

Open Inspirateur opened 1 year ago

Inspirateur commented 1 year ago

I'm using the lib on snack (web) and I'm defining a series of MenuItem like so

const types = ['Series', 'Books', 'Movies', 'Animes', 'Games'];

types.map((t) => {
  return (<MenuItem 
    disabled={t==type} 
    onPress={() => select(t)} 
    disabledTextColor='#ff0000'
    textStyle={{color: "white", fontSize: "1em"}}
  >{t}</MenuItem>)
})

But when I display the menu all items are white including the disabled item which should have been red.
When I remove color: "white" the disabled item shows up red as expected but of course the rest of the text is default color.

I think it should be fixed if possible and if not a workaround should be displayed somewhere in the readme when listing the properties of MenuItem because this seems like a very common need.