facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.58k stars 24.37k forks source link

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

Closed puradox closed 6 years ago

puradox commented 6 years ago

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 (

Welcome to React Native! To get started, edit App.js {instructions}
);

} }

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, }, });


4. `react-native run-ios --simulator "iPad Pro (12.9-inch) (2nd generation)"`

### Expected Behavior

<!--
  How did you expect your project to behave?
  It’s fine if you’re not sure your understanding is correct.
  Just write down what you thought would happen.
-->

A keyboard input automatically gaining focus with a **numeric** keyboard layout.

### Actual Behavior

<!--
  Did something go wrong?
  Is something broken, or not behaving as you expected?
  Describe this section in detail, and attach screenshots if possible.
  Don't just say "it doesn't work"!
-->

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](https://user-images.githubusercontent.com/941763/35587572-0c6a3a98-05b3-11e8-9fb7-0af82d7b46eb.png)

### Reproducible Demo

<!--
  Please share a project that reproduces the issue.
  There are two ways to do it:

    * Create a new app using https://snack.expo.io/ and try to reproduce the issue in it.
      This is useful if you roughly know where the problem is, or can’t share the real code.

    * Or, copy your app and remove things until you’re left with the minimal reproducible demo.
      This is useful for finding the root cause. You may then optionally create a Snack.

  This is a good guide to creating bug demos: https://stackoverflow.com/help/mcve
  Once you’re done, copy and paste the link to the Snack or a public GitHub repository below:
-->

[puradox/NumbersPlease](https://github.com/puradox/NumbersPlease)

<!--
  What happens if you skip this step?

  Someone will read your bug report, and maybe will be able to help you,
  but it’s unlikely that it will get much attention from the team. Eventually,
  the issue will likely get closed in favor of issues that have reproducible demos.

  Please remember that:

    * Issues without reproducible demos have a very low priority.
    * The person fixing the bug would have to do that anyway. Please be respectful of their time.
    * You might figure out the issues yourself as you work on extracting it.

  Thanks for helping us help you!
-->
jayeszee commented 6 years ago

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?

gedeagas commented 6 years ago

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.

react-native-bot commented 6 years ago

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 ContributeWhat to Expect from Maintainers

salmanwaheed commented 6 years ago

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a temporary error. The following address(es) deferred:

mkdirenv@gmail.com Domain salmanwaheed.info has exceeded the max emails per hour (161/150 (107%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------ Received: from github-smtp2-ext3.iad.github.net ([192.30.252.194]:43643 helo=github-smtp2b-ext-cp1-prd.iad.github.net) by box1177.bluehost.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from noreply@github.com) id 1epQUu-003Iys-0q for hello@salmanwaheed.info; Fri, 23 Feb 2018 20:27:40 -0700 Date: Fri, 23 Feb 2018 19:22:21 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1519442846; bh=FTJL8LNlb3O1bW0mYfEWBpMdf5oJT0vQZixvrpeqUBE=; h=From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=CdzYYgnX+KOhRkF71CLBQg7Oyy4T/tWmtM7f9PC51qDUlyeDCpQ4vEExCmj2tXInV Mw5hLsF1ozyZybCgr+Tfp1Lk2R5S5N4Nq3vkpkr1Y1cgipl0XrxJzKfc6Pwc5Pw0RS gJlU8XPa42Z80z9VhQrglQCjHVGwyaXHoP7cSpRs= From: React Native Bot notifications@github.com Reply-To: facebook/react-native reply@reply.github.com To: facebook/react-native react-native@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Message-ID: facebook/react-native/issue/17793/issue_event/1490267458@github.com In-Reply-To: facebook/react-native/issues/17793@github.com References: facebook/react-native/issues/17793@github.com Subject: Re: [facebook/react-native] [TextInput][iPad] Numeric keyboard type not working (#17793) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_5a90da6d87930_42ec2b190881cecc4345db"; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: list X-GitHub-Sender: react-native-bot X-GitHub-Recipient: salmanwaheed X-GitHub-Reason: subscribed List-ID: facebook/react-native List-Archive: https://github.com/facebook/react-native List-Post: mailto:reply@reply.github.com List-Unsubscribe: mailto:unsub+00ef1b3801a5f126cd801cec8f2995f27441d5cf75601d9e92cf0000000116a89c6d92a169ce11758e9c@reply.github.com, https://github.com/notifications/unsubscribe/AO8bOO7d6VbNpm_vIx0OVxF1eOJBW0OCks5tX4BtgaJpZM4Ry62o X-Auto-Response-Suppress: All X-GitHub-Recipient-Address: hello@salmanwaheed.info X-Spam-Status: No, score=0.8 X-Spam-Score: 8 X-Spam-Bar: / X-Ham-Report: Spam detection software, running on the system "box1177.bluehost.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see root\@localhost for details.

Content preview: Closed #17793. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/facebook/react-native/issues/17793#event-1490267458 [...]

Content analysis details: (0.8 points, 5.0 required)

pts rule name description


0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: github.com] -0.5 SPF_PASS SPF: sender matches SPF record 1.3 HTML_IMAGE_ONLY_24 BODY: HTML: images with 2000-2400 bytes of words 0.0 HTML_MESSAGE BODY: HTML included in message 2.5 DCC_CHECK No description available. -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -2.3 AWL AWL: Adjusted score from AWL reputation of From: address X-Spam-Flag: NO

----==_mimepart_5a90da6d87930_42ec2b190881cecc4345db Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #17793.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/facebook/react-native/issues/17793#event-1490267458 ----==_mimepart_5a90da6d87930_42ec2b190881cecc4345db Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #17793.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

----==_mimepart_5a90da6d87930_42ec2b190881cecc4345db--

aMarCruz commented 6 years ago

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

EDIT: ~Solved by setting autoCapitalize="none" See https://github.com/facebook/react-native/issues/12988#issuecomment-337879933~ NOT WORKING, kwyboard is resetting to default

nimabk82 commented 6 years ago

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

saggiyogesh commented 6 years ago

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