Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add rows prop to TextInput component #34488

Conversation

gabrieldonadel
Copy link
Collaborator

Summary

This adds the Android only rows prop to TextInput as requested on #34424 mapping the existing numberOfLines prop to rows. This PR also updates the TextInputExample.android on the RNTester in order to facilitate the manual QA of this.

Changelog

[Android] [Added] - Add rows prop to TextInput component

Test Plan

  1. On Android open the RNTester app and navigate to the TextInput page
  2. Test the TextInput component through the Fixed number of lines section
Screen.Recording.2022-08-23.at.22.52.05.mov

@facebook-github-bot facebook-github-bot added 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. labels Aug 24, 2022
@react-native-bot react-native-bot added Platform: Android Android applications. Type: Enhancement A new feature or enhancement of an existing feature. labels Aug 24, 2022
@analysis-bot
Copy link

analysis-bot commented Aug 24, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,617,394 +276
android hermes armeabi-v7a 7,031,738 +304
android hermes x86 7,917,555 +258
android hermes x86_64 7,891,242 +247
android jsc arm64-v8a 9,494,915 +95
android jsc armeabi-v7a 8,272,632 +126
android jsc x86 9,432,802 +75
android jsc x86_64 10,025,859 +78

Base commit: f3def13
Branch: main

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cipolleschi
Copy link
Contributor

Hi @gabrieldonadel, thanks for the PR. Could you please rebase this onto main?

@gabrieldonadel
Copy link
Collaborator Author

Hi @gabrieldonadel, thanks for the PR. Could you please rebase this onto main?

Sure @cipolleschi, I've just rebased it

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: f3def13
Branch: main

@necolas
Copy link
Contributor

necolas commented Aug 24, 2022

Is there an equivalent to numberOfLines / rows for iOS, or do we need to implement it within the TextInput?

@gabrieldonadel
Copy link
Collaborator Author

Is there an equivalent to numberOfLines / rows for iOS, or do we need to implement it within the TextInput?

Unfortunately no @necolas, but I guess we could implement it using maximumNumberOfLines of NSTextContainer, should I add this new behavior here or in a follow-up PR?

@necolas
Copy link
Contributor

necolas commented Aug 24, 2022

Yeah we can look into unifying text input behavior in another PR. Thanks!

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @gabrieldonadel in 49c9ccd.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 25, 2022
@gabrieldonadel gabrieldonadel deleted the feat/add-rows-to-text-input branch August 25, 2022 23:09
@gabrieldonadel
Copy link
Collaborator Author

@lunaleaps @necolas quick question about these new TextInput props, should we deprecate these old props that are being mapped e.g. #34444 (comment)? Should I open a PR for numberOfLines similar to #34492?

raykle pushed a commit to raykle/react-native that referenced this pull request Aug 27, 2022
Summary:
This adds the Android only `rows` prop to TextInput as requested on facebook#34424 mapping the existing `numberOfLines` prop to `rows`. This PR also updates the TextInputExample.android on the RNTester in order to facilitate the manual QA of this.

## Changelog

[Android] [Added] - Add rows prop to TextInput component

Pull Request resolved: facebook#34488

Test Plan:
1. On Android open the RNTester app and navigate to the TextInput page
2. Test the `TextInput` component through the `Fixed number of lines` section

https://user-images.githubusercontent.com/11707729/186300173-7de79799-25b8-48af-99c0-8e3abeae334f.mov

Reviewed By: christophpurrer

Differential Revision: D38981953

Pulled By: cipolleschi

fbshipit-source-id: d4d84b3c0dac7342ba9a65e2491928fbc61ff4f1
@lunaleaps
Copy link
Contributor

@lunaleaps @necolas quick question about these new TextInput props, should we deprecate these old props that are being mapped e.g. #34444 (comment)? Should I open a PR for numberOfLines similar to #34492?

Let's hold off on this. There's concern that people don't have time to actively migrate their callsites and will get noise. Sorry about the trouble!

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. Merged This PR has been merged. Platform: Android Android applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants