[TextInput][iPad] Numeric keyboard type not working
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: macOS High Sierra 10.13.2 Node: 9.3.0 Yarn: 1.3.2 npm: 5.5.1 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: Not Found
Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.52.2 => 0.52.2
Target Platform: iOS (8.0)
Steps to Reproduce
react-native init NumbersPlease
- Open XCode project and change “General -> Devices” from “iPhone” to “iPad”
- Modify
App.js
to render aTextInput
withkeyboardType='numeric'
:
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
TextInput
} from 'react-native';
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' +
'Cmd+D or shake for dev menu',
android: 'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});
export default class App extends Component<{}> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit App.js
</Text>
<Text style={styles.instructions}>
{instructions}
</Text>
<TextInput
key='hi'
autoFocus={true}
keyboardType='numeric'
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
react-native run-ios --simulator "iPad Pro (12.9-inch) (2nd generation)"
Expected Behavior
A keyboard input automatically gaining focus with a numeric keyboard layout.
Actual Behavior
A keyboard input automatically gaining focus with a default keyboard layout.
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
<input type="number"/> is not showing a number keypad on iOS
number : A text field for specifying a number. Brings up a number pad keyboard in iOS 3.1 and later. Looks damn near...
Read more >iOS decimal pad in web view | Apple Developer Forums
Question: Is it possible to trigger the keyboard type: decimalPad in a HTML form rendered within mobile safari (i.e. numeric keyboard with a...
Read more >TextInput - React Native
This may cause issues with components that have position: 'absolute' while the keyboard is active. To avoid this behavior either specify ...
Read more >How to make iPad display number only keyboard when...
Hi all, I have a text input set to numeric and it shows this type of keyboard - But I want it to...
Read more >iOS force numeric keypad on input type=number demo
iOS force numeric keypad on input type=number demo. dantman. 19.9k. 0. 23. Edit Sandbox. Files. index.html. package.json. Dependencies. External Resources.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think thats the numeric keyboard for ipads. On the phone it shows only numbers but I with an iPad its difficult to have an UI with just numbers. Can someone confirm this?
I’m using 0.56.0. Same problem. Think it’s an iOS related. https://stackoverflow.com/questions/27409483/number-keyboard-in-ipad