Closed VacuumDecay closed 5 years ago
Thanks @VacuumDecay for the PR. Have you tested this change? It looks like this line will cause an error: https://github.com/peacechen/react-native-modal-selector/pull/92/commits/b670be22734333bd5ab6c5c1373ee7768314abc2#diff-168726dbe96b3ce427e7fedce31bb0bcR196
<Text style={[styles.optionTextStyle,this.props.optionTextStyle,isSelectedItem && this.props.selectedItemTextStyle]} {...this.props.optionTextPassThruProps}>
The pass thru props should be inside the array passed to style
.
@peacechen Thanks for taking a look at this. Perhaps I have misunderstood something but I'm not passing any styles to the to the Text component. I tried passing props ellipsizeMode
and 'numberOfLines' like so:
<ModalSelector
data={data}
initValue="Pick an option"
optionTextPassThruProps={{numberOfLines: 1 }}
selectTextPassThruProps={{numberOfLines: 1, ellipsizeMode: 'head' }} />
This worked in my test
Yes you're right. I mistakenly thought this was for the styling.
Would you update the Readme with these new props?
No problem. Readme has been updated
Thanks for the quick turn-around 👍
Added
optionTextPassThruProps
andselectTextPassThruProps
to allow users to pass props to Text components