Skip to content

Commit fac7859

Browse files
eps1lonfacebook-github-bot
authored andcommitted
Add TextInput's inputMode TypeScript types (#35987)
Summary: Forward-porting DefinitelyTyped/DefinitelyTyped#64100 ## Changelog [GENERAL] [FIXED] - Add `TextInput`'s `inputMode` TypeScript types Pull Request resolved: #35987 Test Plan: - [x] DefinitelyTyped/DefinitelyTyped#64100 green Reviewed By: christophpurrer Differential Revision: D42799862 Pulled By: jacdebug fbshipit-source-id: b387fd8bc53e66d6125fee810862de3e292e6e74
1 parent a00cea4 commit fac7859

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Libraries/Components/TextInput/TextInput.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ export type KeyboardTypeOptions =
4545
| KeyboardTypeAndroid
4646
| KeyboardTypeIOS;
4747

48+
export type InputModeOptions =
49+
| 'none'
50+
| 'text'
51+
| 'decimal'
52+
| 'numeric'
53+
| 'tel'
54+
| 'search'
55+
| 'email'
56+
| 'url';
57+
4858
export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send';
4959
export type ReturnKeyTypeAndroid = 'none' | 'previous';
5060
export type ReturnKeyTypeIOS =
@@ -588,6 +598,11 @@ export interface TextInputProps
588598
*/
589599
keyboardType?: KeyboardTypeOptions | undefined;
590600

601+
/**
602+
* Works like the inputmode attribute in HTML, it determines which keyboard to open, e.g. numeric and has precedence over keyboardType.
603+
*/
604+
inputMode?: InputModeOptions | undefined;
605+
591606
/**
592607
* Limits the maximum number of characters that can be entered.
593608
* Use this instead of implementing the logic in JS to avoid flicker.

0 commit comments

Comments
 (0)