Skip to content

Fix maxLength default value when null is passed#53273

Closed
cipolleschi wants to merge 1 commit into
facebook:mainfrom
cipolleschi:export-D80255637
Closed

Fix maxLength default value when null is passed#53273
cipolleschi wants to merge 1 commit into
facebook:mainfrom
cipolleschi:export-D80255637

Conversation

@cipolleschi
Copy link
Copy Markdown
Contributor

Summary:
In c5956da8c0 we landed a change of the default value of maxLength.

While doing that, we missed the case where the app is explicitly passing null for a value for maxLength. When this happens, the props parsing was initializing the maxLength to 0, making not possible to input any value.

This change fixes the issue by ensuring that the default value set when null is consistent with the default value when nothing is passed.

Changelog:

[iOS][Fixed] - Fixed TextInput behavior when maxLength={null} is passed

Differential Revision: D80255637

@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 Aug 14, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80255637

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80255637

@cipolleschi cipolleschi force-pushed the export-D80255637 branch 2 times, most recently from cb0bd96 to 0b99167 Compare August 14, 2025 13:42
Summary:
Pull Request resolved: facebook#53273

In [c5956da](facebook@c5956da) we landed a change of the default value of `maxLength`.

While doing that, we missed the case where the app is explicitly passing `null` for a value for `maxLength`. When this happens, the props parsing was initializing the `maxLength` to 0, making not possible to input any value.

This change fixes the issue by ensuring that the default value set when `null` is consistent with the default value when nothing is passed.

## Changelog:
[iOS][Fixed] - Fixed TextInput behavior when `maxLength={null}` is passed

Reviewed By: GijsWeterings

Differential Revision: D80255637
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80255637

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cipolleschi in 56ad53c

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 14, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 56ad53c.

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 Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants