Skip to content

Commit d690423

Browse files
committed
fix(ios): linkColor fix
1 parent 1e0d017 commit d690423

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: src/label.ios.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -545,22 +545,29 @@ export class Label extends LabelBase {
545545

546546
// we need to pass color because initWithDataOptionsDocumentAttributesError
547547
// will set a default color preventing the UITextView from applying its color
548+
549+
const color = this.color ? (this.color instanceof Color ? this.color : new Color(this.color)) : undefined;
548550
const params = {
549551
text: this.html,
550552
fontSize,
551553
familyName,
552554
fontWeight: fontWeight as any,
553-
color: this.color,
555+
color,
554556
letterSpacing: this.letterSpacing,
555557
lineHeight: this.lineHeight,
556558
textAlignment: nativeView.textAlignment
557559
};
558560
if (!this.isUsingUITextView) {
561+
const linkColor = this.linkColor
562+
? this.linkColor instanceof Color
563+
? this.linkColor
564+
: new Color(this.linkColor)
565+
: undefined;
559566
Object.assign(params, {
560567
useCustomLinkTag: true,
561568
lineBreak: (nativeView as UILabel).lineBreakMode,
562569
linkDecoration: this.linkUnderline ? 'underline' : undefined,
563-
linkColor: this.linkColor
570+
linkColor
564571
});
565572
}
566573
const result = createNativeAttributedString(

0 commit comments

Comments
 (0)