Skip to content

Fix(iOS) TextInput onContentSizeChange not firing on text change on iOS - #59447

Open
amerllica wants to merge 3 commits into
react:mainfrom
amerllica:fix/ios-textinput-oncontentsizechange
Open

amerllica wants to merge 3 commits into
react:mainfrom
amerllica:fix/ios-textinput-oncontentsizechange

Conversation

@amerllica

Copy link
Copy Markdown

Summary:

This PR resolves #52854

On the new arch, onContentSizeChange was sent only from updateLayoutMetrics, so when the layout doesn't change (fixed height, or maxHeight is reached) it never fires after mount. Now it is sent after text changes too (typing and JS value updates), with a layoutIfNeeded before reading contentSize because it is stale inside the change callback. Same behaviour as the old arch. Also _previousContentSize is reset on recycle.

Changelog:

[IOS] [FIXED] - Fix TextInput onContentSizeChange not firing on text change when the layout doesn't change

Test Plan:

RNTester > TextInput > "Content size change with fixed height" (new example), iPhone 17 simulator, iOS 27:

  • Before: type 3 lines, content size stays 16.
  • After: 3 lines gives 55, delete all goes back to 24.

@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 Oct 24, 2026
@amerllica amerllica changed the title Fix TextInput onContentSizeChange not firing on text change on iOS Fix(iOS) TextInput onContentSizeChange not firing on text change on iOS Oct 24, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 24, 2026

This branch has not been deployed

No deployments
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(RN 79.5) TextInput onContentSizeChange is not triggered on iOS

1 participant