mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
feat: Unify TextInput autoComplete and textContentType props (#34523)
Summary: This unifies the Android only `autoComplete` and the iOS only `textContentType` TextInput props with the web `autoComplete` values as requested on https://github.com/facebook/react-native/issues/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: https://github.com/facebook/react-native/pull/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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7ea54a4087
commit
73abcba40f
@@ -437,6 +437,35 @@ exports.examples = ([
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Text Auto Complete',
|
||||
render: function (): React.Node {
|
||||
return (
|
||||
<View>
|
||||
<TextInput
|
||||
autoComplete="country"
|
||||
placeholder="country"
|
||||
style={styles.default}
|
||||
/>
|
||||
<TextInput
|
||||
autoComplete="postal-address-country"
|
||||
placeholder="postal-address-country"
|
||||
style={styles.default}
|
||||
/>
|
||||
<TextInput
|
||||
autoComplete="one-time-code"
|
||||
placeholder="one-time-code"
|
||||
style={styles.default}
|
||||
/>
|
||||
<TextInput
|
||||
autoComplete="sms-otp"
|
||||
placeholder="sms-otp"
|
||||
style={styles.default}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Return key',
|
||||
render: function (): React.Node {
|
||||
|
||||
Reference in New Issue
Block a user