Repository navigation
Conversation
facebook-github-bot
approved these changes
Jun 14, 2018
facebook-github-bot
left a comment
Contributor
There was a problem hiding this comment.
@mdvacca is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Contributor
|
Thanks for working on this @JPanneel. |
Author
|
@mdvacca Is that something other than what is included in react/react-native-website#405 ? If so, I am not sure where to update the documentation you mention. |
Contributor
|
oh I missed the PR for doc, thanks |
Author
|
No problem. Thanks for the fast feedback! |
grabbou
pushed a commit
that referenced
this pull request
Jun 27, 2018
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. #12988 #12977 #17473 #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" b638847 Documentation PR: react/react-native-website#405 [ANDROID] [ENHANCEMENT] [TextInput] - Added "decimal-pad" keyboard type Closes #19714 Differential Revision: D8429185 Pulled By: mdvacca fbshipit-source-id: 6b56da2088f2be427ebffa04c4e17c91ffb9f7d9
davidliu
pushed a commit
to evie/react-native
that referenced
this pull request
Sep 11, 2018
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. react#12988 react#12977 react#17473 react#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" react@b638847 Documentation PR: react/react-native-website#405 [ANDROID] [ENHANCEMENT] [TextInput] - Added "decimal-pad" keyboard type Closes react#19714 Differential Revision: D8429185 Pulled By: mdvacca fbshipit-source-id: 6b56da2088f2be427ebffa04c4e17c91ffb9f7d9
|
See my comment #22005. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Relevant links to documentation
Additional benefit
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. #12988 #12977 #17473 #17474
Test Plan
Related PRs
This PR follows the same approach as the recently merged PR introducing "number-pad" b638847
Documentation PR: react/react-native-website#405
Release Notes
[ANDROID] [ENHANCEMENT] [TextInput] - Added "decimal-pad" keyboard type