Skip to content

Commit c1bccbe

Browse files
committed
fix: return anyTextHaveBeenModified
1 parent d66dc4b commit c1bccbe

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ios/EnrichedTextInputView.mm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,9 @@ - (CGSize)measureSize:(CGFloat)maxWidth {
706706
container.size = CGSizeMake(maxWidth, CGFLOAT_MAX);
707707
[layoutManager ensureLayoutForTextContainer:container];
708708
CGRect usedRect = [layoutManager usedRectForTextContainer:container];
709-
textView.contentSize = CGSizeMake(maxWidth, ceil(usedRect.size.height));
710-
return CGSizeMake(maxWidth, ceil(usedRect.size.height));
709+
CGSize contentSize = CGSizeMake(maxWidth, ceil(usedRect.size.height));
710+
textView.contentSize = contentSize;
711+
return contentSize;
711712
}
712713

713714
// make sure the newest state is kept in _state property
@@ -1364,8 +1365,10 @@ - (void)anyTextMayHaveBeenModified {
13641365

13651366
- (void)didMoveToWindow {
13661367
[super didMoveToWindow];
1367-
// used to run all lifecycle callbacks
1368-
[self layoutIfNeeded];
1368+
if (self.window != nil) {
1369+
// used to run all lifecycle callbacks
1370+
[self anyTextMayHaveBeenModified];
1371+
}
13691372
}
13701373

13711374
// MARK: - UITextView delegate methods

0 commit comments

Comments
 (0)