Skip to content

[TextInput][iPad] Numeric keyboard type not working #17793

Description

@puradox

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

Activity

  1. jayeszee commented on Jan 31, 2018

    @jayeszee

    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?

  2. gedeagas commented on Jan 31, 2018

    @gedeagas
    Contributor

    Yep, as @jayeszee mentioned this is the default behavior on iPad because apparently, it's "Hard" to have a UI with just numbers on iPad.

  3. react-native-bot commented on Feb 24, 2018

    @react-native-bot
    Collaborator

    Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

    I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

    How to Contribute • What to Expect from Maintainers

  4. added
    Ran CommandsOne of our bots successfully processed a command.
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Feb 24, 2018
  5. removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Feb 24, 2018
  6. salmanwaheed commented on Feb 24, 2018

    @salmanwaheed
  7. aMarCruz commented on Mar 4, 2018

    @aMarCruz

    @gedeagas , this bug is present in Android for RN 0.53.3

    EDIT:
    Solved by setting autoCapitalize="none"
    See #12988 (comment)

    NOT WORKING, kwyboard is resetting to default

  8. nimabk82 commented on Jul 5, 2018

    @nimabk82

    I'm using react native 0.55.2 and I still have this problem in IPad

  9. saggiyogesh commented on Sep 4, 2018

    @saggiyogesh

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

  10. locked as resolved and limited conversation to collaborators on Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions