Skip to content

Commit

Permalink
Add enterKeyHint in TextInput type declaration (#37624)
Browse files Browse the repository at this point in the history
Summary:
Resolves: #37622

Related:
#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: #37624

Reviewed By: cortinico, NickGerleman

Differential Revision: D46292040

Pulled By: lunaleaps

fbshipit-source-id: a037b7f8dd0d60880dcf1aec64749546fa54a95d
  • Loading branch information
tarunrajput authored and facebook-github-bot committed Jun 5, 2023
1 parent 46d14ce commit 5062553
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 5062553

Please sign in to comment.