diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts index ff029fb29b5f8c..8badb2a9d39de5 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts @@ -70,6 +70,15 @@ export type ReturnKeyTypeOptions = | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; +export type EnterKeyHintTypeAndroid = 'previous'; +export type EnterKeyHintTypeIOS = 'enter'; +export type EnterKeyHintType = 'done' | 'go' | 'next' | 'search' | 'send'; + +export type EnterKeyHintTypeOptions = + | EnterKeyHintType + | EnterKeyHintTypeAndroid + | EnterKeyHintTypeIOS; + type DataDetectorTypes = | 'phoneNumber' | 'link' @@ -779,6 +788,12 @@ export interface TextInputProps */ returnKeyType?: ReturnKeyTypeOptions | undefined; + /** + * Determines what text should be shown to the return key on virtual keyboards. + * Has precedence over the returnKeyType prop. + */ + enterKeyHint?: EnterKeyHintTypeOptions | undefined; + /** * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. * The default value is false. diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.js b/packages/react-native/Libraries/Components/TextInput/TextInput.js index df890974ece66c..67ad18c0c19b42 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -223,13 +223,16 @@ export type TextContentType = | 'oneTimeCode'; export type enterKeyHintType = - | 'enter' + // Cross Platform | 'done' | 'go' | 'next' - | 'previous' | 'search' - | 'send'; + | 'send' + // Android-only + | 'previous' + // iOS-only + | 'enter'; type PasswordRules = string;