|
17 | 17 | #import "RCTShadowRawText.h" |
18 | 18 | #import "RCTText.h" |
19 | 19 | #import "RCTUtils.h" |
| 20 | +#import "RCTConvert.h" |
20 | 21 |
|
21 | 22 | NSString *const RCTShadowViewAttributeName = @"RCTShadowViewAttributeName"; |
22 | 23 | NSString *const RCTIsHighlightedAttributeName = @"IsHighlightedAttributeName"; |
@@ -166,7 +167,13 @@ - (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(css_measur |
166 | 167 |
|
167 | 168 | NSTextContainer *textContainer = [NSTextContainer new]; |
168 | 169 | textContainer.lineFragmentPadding = 0.0; |
169 | | - textContainer.lineBreakMode = _numberOfLines > 0 ? NSLineBreakByTruncatingTail : NSLineBreakByClipping; |
| 170 | + |
| 171 | + if (_numberOfLines > 0) { |
| 172 | + textContainer.lineBreakMode = _lineBreakMode; |
| 173 | + } else { |
| 174 | + textContainer.lineBreakMode = NSLineBreakByClipping; |
| 175 | + } |
| 176 | + |
170 | 177 | textContainer.maximumNumberOfLines = _numberOfLines; |
171 | 178 | textContainer.size = (CGSize){widthMode == CSS_MEASURE_MODE_UNDEFINED ? CGFLOAT_MAX : width, CGFLOAT_MAX}; |
172 | 179 |
|
@@ -451,6 +458,7 @@ - (void)set##setProp:(type)value; \ |
451 | 458 | RCT_TEXT_PROPERTY(LetterSpacing, _letterSpacing, CGFloat) |
452 | 459 | RCT_TEXT_PROPERTY(LineHeight, _lineHeight, CGFloat) |
453 | 460 | RCT_TEXT_PROPERTY(NumberOfLines, _numberOfLines, NSUInteger) |
| 461 | +RCT_TEXT_PROPERTY(LineBreakMode, _lineBreakMode, NSLineBreakMode) |
454 | 462 | RCT_TEXT_PROPERTY(TextAlign, _textAlign, NSTextAlignment) |
455 | 463 | RCT_TEXT_PROPERTY(TextDecorationColor, _textDecorationColor, UIColor *); |
456 | 464 | RCT_TEXT_PROPERTY(TextDecorationLine, _textDecorationLine, RCTTextDecorationLineType); |
|
0 commit comments