ide / react-native-button

A button for React apps
MIT License
773 stars 129 forks source link

Provide numberOfLines prop for the text of the button #35

Closed varungupta85 closed 8 years ago

varungupta85 commented 8 years ago

I want to be able to show ... if the text length is greater than available width which can be done by specifying numberOfLines property as 1 in the Text node but this property is currently not read in the Button component. I also tried to add it myself in the Button.js file but for some reason it didn't work. The property is not present on the Text node when I inspect it in the inspector but I have verified that the property was added in the code using the console logs. So, not sure why does it not appear in the rendered Text node.

varungupta85 commented 8 years ago

Please ignore the bit about the numberOfLines property not present on the Text node even if I add it to the Button.js file. It was happening because the width of the Text was not defined due to which it didn't have to wrap the text to show an ... and hence the prop was not shown in the inspector. Once, the width was set, I did see the ellipsis. I have create #36 for this change.