mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add enterKeyHint in TextInput type declaration (#37624)
Summary: Resolves: https://github.com/facebook/react-native/issues/37622 Related: https://github.com/facebook/react-native/pull/34482 https://reactnative.dev/docs/textinput#enterkeyhint ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal][Added]: Add enterKeyHint in TextInput type declaration Pull Request resolved: https://github.com/facebook/react-native/pull/37624 Reviewed By: cortinico, NickGerleman Differential Revision: D46292040 Pulled By: lunaleaps fbshipit-source-id: a037b7f8dd0d60880dcf1aec64749546fa54a95d
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user