Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ - (void)layoutSubviews
[super layoutSubviews];

CGRect textFrame = UIEdgeInsetsInsetRect(self.bounds, self.textContainerInset);

// Sync NSTextContainer.size with the current container bounds to prevent
// _UITextLayoutFragmentView from retaining a stale width after frame changes.
self.textContainer.size = CGSizeMake(textFrame.size.width, CGFLOAT_MAX);

CGFloat placeholderHeight = [_placeholderView sizeThatFits:textFrame.size].height;
textFrame.size.height = MIN(placeholderHeight, textFrame.size.height);
_placeholderView.frame = textFrame;
Expand Down
Loading