mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 06:04:15 +00:00
Add phone-pad keyboard
Summary: With the numeric keyboard now being an actual numeric keyboard (before it was actually phone-pad), we need a proper phone-pad keyboard as well. public Reviewed By: dmmiller Differential Revision: D2830707 fb-gh-sync-id: 80a1d314eac730e691de73a31342c014a2fa5ba6
This commit is contained in:
parent
ebf42d9813
commit
25c3dd140f
@ -242,6 +242,7 @@ exports.examples = [
|
||||
'default',
|
||||
'email-address',
|
||||
'numeric',
|
||||
'phone-pad',
|
||||
];
|
||||
var examples = keyboardTypes.map((type) => {
|
||||
return (
|
||||
|
@ -134,14 +134,14 @@ var TextInput = React.createClass({
|
||||
keyboardType: PropTypes.oneOf([
|
||||
// Cross-platform
|
||||
'default',
|
||||
'numeric',
|
||||
'email-address',
|
||||
'numeric',
|
||||
'phone-pad',
|
||||
// iOS-only
|
||||
'ascii-capable',
|
||||
'numbers-and-punctuation',
|
||||
'url',
|
||||
'number-pad',
|
||||
'phone-pad',
|
||||
'name-phone-pad',
|
||||
'decimal-pad',
|
||||
'twitter',
|
||||
|
@ -60,6 +60,7 @@ public class ReactTextInputManager extends
|
||||
|
||||
private static final String KEYBOARD_TYPE_EMAIL_ADDRESS = "email-address";
|
||||
private static final String KEYBOARD_TYPE_NUMERIC = "numeric";
|
||||
private static final String KEYBOARD_TYPE_PHONE_PAD = "phone-pad";
|
||||
private static final InputFilter[] EMPTY_FILTERS = new InputFilter[0];
|
||||
|
||||
@Override
|
||||
@ -278,6 +279,8 @@ public class ReactTextInputManager extends
|
||||
flagsToSet = INPUT_TYPE_KEYBOARD_NUMBERED;
|
||||
} else if (KEYBOARD_TYPE_EMAIL_ADDRESS.equalsIgnoreCase(keyboardType)) {
|
||||
flagsToSet = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS | InputType.TYPE_CLASS_TEXT;
|
||||
} else if (KEYBOARD_TYPE_PHONE_PAD.equalsIgnoreCase(keyboardType)) {
|
||||
flagsToSet = InputType.TYPE_CLASS_PHONE;
|
||||
}
|
||||
updateStagedInputTypeFlag(
|
||||
view,
|
||||
|
Loading…
x
Reference in New Issue
Block a user