react-native-modal-selector icon indicating copy to clipboard operation
react-native-modal-selector copied to clipboard

Selected item for alternative component

Open rebornishard opened this issue 5 years ago • 3 comments

Optionally provide a component key which overrides the default label text:

[{
  key: 5,
  label: 'Red Apples',
  component: <View style={{backgroundColor: 'red'}}><Text style={{color: 'white'}}>Red Apples custom component ☺</Text></View>
}]

selectedItemTextStyle not working for this one do i need add another component for selected style ?

thanks

rebornishard avatar Mar 19 '19 11:03 rebornishard

I believe that selectedItemTextStyle won't work for custom selector components. Would you like to submit a PR to enable it? I'm not sure how that would be done on a custom component though.

peacechen avatar Mar 19 '19 15:03 peacechen

selectedItemTextStyle works for custom component but this is really bad that it distinguishes options on the basis of label and not on the key. So, if you have same options under different sections then they'll all be highlighted

deepankar14693 avatar Nov 13 '19 10:11 deepankar14693

Thanks for noticing that @deepankar14693 . Please submit a PR to match based on key instead of label.

peacechen avatar Nov 13 '19 14:11 peacechen