Skip to content

Fix React Native multiline TextInput container overflow#56836

Open
cipolleschi wants to merge 1 commit into
facebook:mainfrom
cipolleschi:export-D104896433
Open

Fix React Native multiline TextInput container overflow#56836
cipolleschi wants to merge 1 commit into
facebook:mainfrom
cipolleschi:export-D104896433

Conversation

@cipolleschi
Copy link
Copy Markdown
Contributor

Summary:
The text input field in the Marketplace Review Response Composer (and all React Native multiline TextInput instances) incorrectly expands beyond its container bounds. The _UITextLayoutFragmentView has a width that exceeds the RCTTextInputComponentView container width by 47 points.

Root cause: RCTUITextView.layoutSubviews does not update self.textContainer.size when parent view bounds change. When RCTTextInputComponentView.updateLayoutMetrics sets a new frame and textContainerInset, the NSTextContainer.size inside the UITextView retains its old (wider) value.

Fix: Add self.textContainer.size = CGSizeMake(textFrame.size.width, CGFLOAT_MAX) in layoutSubviews after computing textFrame, so the text container width stays in sync with container bounds.

Changelog

[iOS][Fixed] - Update text view bounding to avoid overflowing

Differential Revision: D104896433

Summary:
The text input field in the Marketplace Review Response Composer (and all React Native multiline TextInput instances) incorrectly expands beyond its container bounds. The _UITextLayoutFragmentView has a width that exceeds the RCTTextInputComponentView container width by 47 points.

Root cause: RCTUITextView.layoutSubviews does not update self.textContainer.size when parent view bounds change. When RCTTextInputComponentView.updateLayoutMetrics sets a new frame and textContainerInset, the NSTextContainer.size inside the UITextView retains its old (wider) value.

Fix: Add self.textContainer.size = CGSizeMake(textFrame.size.width, CGFLOAT_MAX) in layoutSubviews after computing textFrame, so the text container width stays in sync with container bounds.

## Changelog
[iOS][Fixed] - Update text view bounding to avoid overflowing

Differential Revision: D104896433
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 15, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 15, 2026

@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104896433.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant