question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TextInput][iPad] Numeric keyboard type not working

See original GitHub issue

Is 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

  1. react-native init NumbersPlease
  2. Open XCode project and change “General -> Devices” from “iPhone” to “iPad”
  3. Modify App.js to render a TextInput with keyboardType='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,
  },
});
  1. 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.

simulator screen shot - ipad pro 12 9-inch 2nd generation - 2018-01-30 at 11 30 26

Reproducible Demo

puradox/NumbersPlease

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jayeszeecommented, Jan 31, 2018

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?

0reactions
saggiyogeshcommented, Sep 4, 2018

I’m using 0.56.0. Same problem. Think it’s an iOS related. https://stackoverflow.com/questions/27409483/number-keyboard-in-ipad

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found