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: Unify TextInput autoComplete and textContentType props #34523

Closed

Conversation

gabrieldonadel
Copy link
Collaborator

Summary

This unifies the Android only autoComplete and the iOS only textContentType TextInput props with the web autoComplete values as requested on #34424. I left the textContentType prop and the current supported autoComplete values untouched in order to avoid having a breaking change. This also updates RNTester to include test cases using the new autoComplete values

Changelog

[General] [Changed] - Unify TextInput autoComplete and textContentType props

Test Plan

  1. Open the RNTester app and navigate to the TextInput page
  2. Test the TextInput component through the Text Auto Complete section
Screen.Recording.2022-08-29.at.00.37.52.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 29, 2022
@analysis-bot
Copy link

analysis-bot commented Aug 29, 2022

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

Base commit: b6bf1fd
Branch: main

@analysis-bot
Copy link

analysis-bot commented Aug 29, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,635,922 -2,612
android hermes armeabi-v7a 7,047,750 -3,108
android hermes x86 7,937,816 -2,470
android hermes x86_64 7,909,721 -2,583
android jsc arm64-v8a 9,512,517 +281
android jsc armeabi-v7a 8,287,808 -48
android jsc x86 9,452,091 +524
android jsc x86_64 10,043,310 +679

Base commit: b6bf1fd
Branch: main

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@gabrieldonadel
Copy link
Collaborator Author

@necolas do you mind checking what is causing internal builds and tests to fail?

@necolas
Copy link
Contributor

necolas commented Sep 5, 2022

Someone else will have to import this PR. I closed that internal diff as I'm away for the rest of September

@necolas
Copy link
Contributor

necolas commented Sep 6, 2022

Ping @cipolleschi or @jacdebug to import

@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.

@@ -1492,6 +1602,21 @@ const ExportedForwardRef: React.AbstractComponent<
keyboardType={
inputMode ? inputModeToKeyboardTypeMap[inputMode] : keyboardType
}
autoComplete={
Platform.OS === 'android'
? // $FlowFixMe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this suppressing? If we do add a suppression, could we suppress the specific error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @NickGerleman this is suppressing the prop-missing error because the autoCompleteWebToAutoCompleteAndroidMap object does not include all autoComplete keys/values. The reason for this is just because it would make the object super huge and we can just fallback to autoComplete when autoCompleteWebToTextContentTypeMap[autoComplete] is undefined. I've just updated the suppression to specify the prop-missing error tho

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @gabrieldonadel in 73abcba.

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 Sep 8, 2022
@gabrieldonadel gabrieldonadel deleted the feat/redefine-auto-complete branch September 8, 2022 17:45
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…k#34523)

Summary:
This unifies the Android only  `autoComplete` and the iOS only `textContentType` TextInput props with the web `autoComplete` values as requested on facebook#34424. I left the `textContentType` prop and the current supported `autoComplete` values untouched in order to avoid having a breaking change. This also updates RNTester to include test cases using the new `autoComplete` values

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - Unify TextInput autoComplete and textContentType props

Pull Request resolved: facebook#34523

Test Plan:
1. Open the RNTester app and navigate to the TextInput page
2. Test the `TextInput` component through the `Text Auto Complete` section

https://user-images.githubusercontent.com/11707729/187118267-3b509631-7b84-47b7-a580-567a7f5b483f.mov

Reviewed By: NickGerleman

Differential Revision: D39104545

Pulled By: cipolleschi

fbshipit-source-id: a0d4b1b9ab336854a741a9efe4a62c3da0b5c0f4
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. 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.

6 participants