Skip to content

Commit 3e0eb6e

Browse files
committed
fix(ios): ensure we use autoFontSize in onMeasure
1 parent 662a899 commit 3e0eb6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/label.ios.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ export class Label extends LabelBase {
401401

402402
const height = layout.getMeasureSpecSize(heightMeasureSpec);
403403
const heightMode = layout.getMeasureSpecMode(heightMeasureSpec);
404-
405404
if (this.autoFontSize) {
406405
this.textViewDidChange(
407406
nativeView,
@@ -818,7 +817,10 @@ export class Label extends LabelBase {
818817

819818
textViewDidChange(textView: UITextView, width?, height?) {
820819
if (this.autoFontSize) {
821-
if ((!textView.attributedText && !textView.text) || CGSizeEqualToSize(textView.bounds.size, CGSizeZero)) {
820+
if (
821+
(!textView.attributedText && !textView.text) ||
822+
(width === undefined && height === undefined && CGSizeEqualToSize(textView.bounds.size, CGSizeZero))
823+
) {
822824
return;
823825
}
824826
const nbLines = textView.textContainer.maximumNumberOfLines;

0 commit comments

Comments
 (0)