From 25c5f17ca6d56284b8bc7abcf4f9449971fc8da0 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Sat, 11 Aug 2018 03:58:05 -0400 Subject: [PATCH] Add keyboardType to AlertIOS prompt --- types/react-native/index.d.ts | 3 ++- types/react-native/test/index.tsx | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 40a9375126..8d591b6bd1 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -6790,7 +6790,8 @@ export interface AlertIOSStatic { message?: string, callbackOrButtons?: ((value: string) => void) | Array, type?: AlertType, - defaultValue?: string + defaultValue?: string, + keyboardType?: KeyboardType | KeyboardTypeIOS, ) => void; } diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 93eeabd985..2980ac9f62 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -16,6 +16,7 @@ import { Alert, AppState, AppStateIOS, + AlertIOS, BackAndroid, BackHandler, Button, @@ -730,3 +731,25 @@ class AccessibilityTest extends React.Component { const KeyboardAvoidingViewTest = () => ( ); + + +const AlertIOSTest = () => { + AlertIOS.prompt( + 'My Prompt', + 'Enter your email', + [ + { + text: 'Cancel', + style: 'cancel' + }, + { + text: 'Add', + onPress: (value: string) => { + console.log(value); + }, + }, + ], + 'default', + 'email-address' + ); +}