From c595509048cc5f6cab360cd2ccbe7c86405baf92 Mon Sep 17 00:00:00 2001 From: Khaer Ansori Date: Wed, 14 Mar 2018 14:41:58 -0700 Subject: [PATCH] Add number-pad keyboardType Summary: On Android there's no number-pad but numeric instead, for my use-case I need number only (without decimal and sign, for PIN input) I write it so there's no breaking change for those already using the `TextInput` Component None [ANDROID][ENHANCEMENT][Component] Add number-pad keyboardType Closes https://github.com/facebook/react-native/pull/18350 Reviewed By: achen1 Differential Revision: D7269721 Pulled By: mdvacca fbshipit-source-id: 82571dce948e0cf2e4354dc46c69198ec69ba65a --- Libraries/Components/TextInput/TextInput.js | 4 ++-- .../react/views/textinput/ReactTextInputManager.java | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index deb3b40e4..2c6c4f8ef 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -244,6 +244,7 @@ const TextInput = createReactClass({ * * - `default` * - `numeric` + * - `number-pad` * - `email-address` * - `phone-pad` * @@ -254,7 +255,6 @@ const TextInput = createReactClass({ * - `ascii-capable` * - `numbers-and-punctuation` * - `url` - * - `number-pad` * - `name-phone-pad` * - `decimal-pad` * - `twitter` @@ -272,11 +272,11 @@ const TextInput = createReactClass({ 'email-address', 'numeric', 'phone-pad', + 'number-pad', // iOS-only 'ascii-capable', 'numbers-and-punctuation', 'url', - 'number-pad', 'name-phone-pad', 'decimal-pad', 'twitter', diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 637027140..2c5013a7e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -68,8 +68,9 @@ public class ReactTextInputManager extends BaseViewManager