@@ -410,7 +410,7 @@ export class Label extends LabelBase {
410
410
}
411
411
if ( this . nativeViewProtected ) {
412
412
this . nativeViewProtected . attributedText = this . attributedString ;
413
- this . _requestLayoutOnTextChanged ( )
413
+ this . _requestLayoutOnTextChanged ( ) ;
414
414
}
415
415
}
416
416
updateHTMLString ( fontSize ?: number ) {
@@ -580,26 +580,31 @@ export class Label extends LabelBase {
580
580
`Invalid text decoration value: ${ style . textDecoration } . Valid values are: 'none', 'underline', 'line-through', 'underline line-through'.`
581
581
) ;
582
582
}
583
+ let paragraphStyle ;
584
+ const createParagraphStyle = ( ) => {
585
+ if ( ! paragraphStyle ) {
586
+ paragraphStyle = NSMutableParagraphStyle . alloc ( ) . init ( ) ;
587
+ paragraphStyle . alignment = this . nativeTextViewProtected . textAlignment ;
588
+ // make sure a possible previously set text alignment setting is not lost when line height is specified
589
+ dict . set ( NSParagraphStyleAttributeName , paragraphStyle ) ;
590
+ }
591
+ } ;
583
592
if ( style . letterSpacing !== 0 && this . nativeTextViewProtected . font ) {
584
593
const kern = style . letterSpacing * this . nativeTextViewProtected . font . pointSize ;
585
594
dict . set ( NSKernAttributeName , kern ) ;
595
+ createParagraphStyle ( ) ;
586
596
}
587
- const isTextView = false ;
597
+ // const isTextView = false;
588
598
if ( style . lineHeight !== undefined ) {
589
599
let lineHeight = style . lineHeight ;
590
600
if ( lineHeight === 0 ) {
591
601
lineHeight = 0.00001 ;
592
602
}
593
- const paragraphStyle = NSMutableParagraphStyle . alloc ( ) . init ( ) ;
603
+ createParagraphStyle ( ) ;
594
604
paragraphStyle . minimumLineHeight = lineHeight ;
595
605
paragraphStyle . maximumLineHeight = lineHeight ;
596
- // make sure a possible previously set text alignment setting is not lost when line height is specified
597
- paragraphStyle . alignment = this . nativeTextViewProtected . textAlignment ;
598
- dict . set ( NSParagraphStyleAttributeName , paragraphStyle ) ;
599
- } else if ( isTextView ) {
600
- const paragraphStyle = NSMutableParagraphStyle . alloc ( ) . init ( ) ;
601
- paragraphStyle . alignment = this . nativeTextViewProtected . textAlignment ;
602
- dict . set ( NSParagraphStyleAttributeName , paragraphStyle ) ;
606
+ // } else if (isTextView) {
607
+ // createParagraphStyle();
603
608
}
604
609
const source = getTransformedText ( isNullOrUndefined ( this . text ) ? '' : `${ this . text } ` , this . textTransform ) ;
605
610
if ( dict . size > 0 ) {
0 commit comments