Skip to content

Commit

Permalink
Add proper logic for rendering ellipsis
Browse files Browse the repository at this point in the history
  • Loading branch information
nbclark committed Aug 10, 2016
1 parent 029cecb commit c817f39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/Text/TextStylePropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ module.exports = {
whiteSpace: string,
/* @platform web */
wordWrap: string,
writingDirection: oneOf([ 'auto', 'ltr', 'rtl' ])
writingDirection: oneOf([ 'auto', 'ltr', 'rtl' ]),
WebkitLineClamp: string,
WebkitBoxOrient: oneOf([ 'vertical', 'horizontal' ])
}
4 changes: 2 additions & 2 deletions src/components/Text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Text extends Component {
!selectable && styles.notSelectable,
numberOfLines === 1 && styles.singleLineStyle,
numberOfLines > 1 && styles.multiLineStyle,
numberOfLines > 1 && { '-webkit-line-clamp': numberOfLines}
numberOfLines > 1 && {WebkitLineClamp: '' + numberOfLines}
]
})
}
Expand Down Expand Up @@ -81,7 +81,7 @@ const styles = StyleSheet.create({
multiLineStyle: {
overflow: 'hidden',
display: '-webkit-box',
'-webkit-box-orient': 'vertical'
WebkitBoxOrient: 'vertical'
}
})

Expand Down

0 comments on commit c817f39

Please sign in to comment.