react-native/Libraries/Components
Jens Panneel 75e49a0637 Feature/add decimal pad to android (#19714)
Summary:
For a current use-case we need the a keyboard with characters 0-9 and a decimal point (or comma depending on language settings)

This exists on iOS as UIKeyboardType "decimalPad" and this is what react-native maps to for both "numeric" and "decimal-pad". This also exists on Android as inputType "numberDecimal", but is currently not accessible through react-native.

This PR maps the value "decimal-pad" of the keyboardType property of TextInput to the Android inputType "numberDecimal", effectively making "decimal-pad" cross platform without breaking anything.

* https://facebook.github.io/react-native/docs/textinput.html#keyboardtype
* https://developer.apple.com/documentation/uikit/uikeyboardtype
* https://developer.android.com/reference/android/widget/TextView#attr_android:inputType

There is this bug in some Samsung keyboards where both the - sign and decimal sign disappear when the keyboardType is set to "number" and both the "signed" and "decimal" flags are set. (Like is the case when using the react-native keyboardType prop "numeric".) https://androidforums.com/threads/numeric-soft-keyboard-missing-minus-sign-in-android-8-0-samsung-a5.1272628/

For developers that need decimal numbers but not negative ones, using "decimal-pad" will provide a workaround. I reproduced this on a Samsung A5 only, but maybe other phones have this exact issue. https://github.com/facebook/react-native/issues/12988 https://github.com/facebook/react-native/issues/12977 https://github.com/facebook/react-native/issues/17473 https://github.com/facebook/react-native/issues/17474

* Added testcase consistent with existing keyboardType tests
* Also added testcase for the related, but missing number-pad

This PR follows the same approach as the recently merged PR introducing "number-pad" b638847a46

Documentation PR: https://github.com/facebook/react-native-website/pull/405

 [ANDROID] [ENHANCEMENT] [TextInput] - Added "decimal-pad" keyboard type
Closes https://github.com/facebook/react-native/pull/19714

Differential Revision: D8429185

Pulled By: mdvacca

fbshipit-source-id: 6b56da2088f2be427ebffa04c4e17c91ffb9f7d9
2018-06-14 14:01:51 -07:00
..
AccessibilityInfo Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
ActivityIndicator Revert D8342904: [StrictMode] Fix more forwardRef displayNames 2018-06-11 20:46:27 -07:00
AppleTV Spread TVViewProps into ViewProps instead of intersection 2018-05-12 10:35:26 -07:00
CheckBox Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
Clipboard Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
DatePicker RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
DatePickerAndroid Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
DrawerAndroid Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
Keyboard Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
MaskedView RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
Navigation Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Picker Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
ProgressBarAndroid Revert D8342904: [StrictMode] Fix more forwardRef displayNames 2018-06-11 20:46:27 -07:00
ProgressViewIOS RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
RefreshControl RefreshControl ES6 Class 2018-06-01 10:25:30 -07:00
SafeAreaView RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
ScrollView Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
SegmentedControlIOS RN: Remove Native Prop Validation 2018-06-01 12:54:14 -07:00
Slider Revert D8342904: [StrictMode] Fix more forwardRef displayNames 2018-06-11 20:46:27 -07:00
StatusBar Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Switch Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
TabBarIOS Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
TextInput Feature/add decimal pad to android (#19714) 2018-06-14 14:01:51 -07:00
TimePickerAndroid Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
ToastAndroid Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
ToolbarAndroid Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
Touchable Trigger onFocus/onBlur instead of onPressIn/onPressOut (eventually, but for now just deprecate) (#18470) 2018-06-11 15:31:15 -07:00
UnimplementedViews Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
View fix forwardRef displayName on Text and View 2018-06-11 19:22:51 -07:00
ViewPager Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
WebView Don't pass additional args to requireNativeComponent in .android.js files 2018-06-10 15:38:32 -07:00
Button.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
ScrollResponder.js Fix keyboard handling with keyboardShouldPersistTaps: never 2018-05-14 23:46:50 -07:00
StaticContainer.react.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
StaticRenderer.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Subscribable.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00