Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return-key 'next' on numeric TextInput doesn't work on iOS since 2019?!? #31794

Closed
Hustenbonbon opened this issue Jun 30, 2021 · 11 comments
Closed
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Hustenbonbon
Copy link

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

If using another returnKeyType then 'done' on a numeric TextInput, it isn't shown at all.

React Native version:

System:
OS: macOS 11.4
CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
Memory: 34.68 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.22.1 - /var/folders/pz/j_z7p6bs1gq08f42zb9x_fj00000gn/T/yarn--1625065239113-0.5195055990868227/node
Yarn: 1.22.10 - /var/folders/pz/j_z7p6bs1gq08f42zb9x_fj00000gn/T/yarn--1625065239113-0.5195055990868227/yarn
npm: 6.14.12 - ~/.nvm/versions/node/v12.22.1/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
Languages:
Java: 15.0.1 - /usr/local/opt/openjdk/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17 => 17.0.1
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Create a TextInput
  2. Set:
    keyboardType="numeric"
    returnKeyType={'next'}
  3. Run on iOS

Expected Results

A next button in the toolbar above the keyboard

Snack, code example, screenshot, or link to a repository:

This problem seems to be occurring now for a longer time, the creator of the original issue didn't follow the template though: #26885

<TextInput keyboardType="numeric" returnKeyType={ 'done' } />
image

<TextInput keyboardType="numeric" returnKeyType={ 'next' } />
image

@ken0nek
Copy link
Contributor

ken0nek commented Jul 1, 2021

I think it's not a React Native issue.

We cannot display Done button and Next button when we specify Number Pad, Phone Pad, or Decimal Pad etc. even when we use UIKit.

@Hustenbonbon
Copy link
Author

@ken0nek I don't understand how your comment and this issue are related. On a "done" return key type, react native shows a toolbar. On "next", it doesn't show a toolbar. This inconsistency looks like a bug to me and is not related to a toolbar showing at all or not on UIKit.
Please correct me if I misunderstood your comment.

@ken0nek
Copy link
Contributor

ken0nek commented Aug 2, 2021

Hi @Hustenbonbon, I could reproduce the toolbar behavior. I misunderstood the issue.

@ken0nek
Copy link
Contributor

ken0nek commented Aug 2, 2021

@ken0nek
Copy link
Contributor

ken0nek commented Aug 2, 2021

I worked on it a little bit and I can display "Next" button even when we specify 'next' for returnKeyType, but having trouble with how to find the next responder if any because there are no clues like view tags or refs...

I think that's why we didn't have this next button implementation in react native right now.

Screen Shot

refs

@Hustenbonbon
Copy link
Author

Wow, thanks for all that investigation and trying out. I would like to help but don't know when I would find the time for this. Probably there isn't a native bridge yet

@safaiyeh
Copy link
Contributor

safaiyeh commented Aug 2, 2021

Appreciate the investigation everyone.

@safaiyeh safaiyeh added Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. and removed Needs: Triage 🔍 labels Aug 2, 2021
@leonhoffmann86
Copy link

Try to use the InputAccessoryView for customization of the keyboard input accessory view on iOS. https://reactnative.dev/docs/inputaccessoryview

@therealgeekfruit
Copy link

You can add a property to the TextInput returnKeyType="done" if you're using it for a numeric/phone-pad input.
<TextInput keyboardType="numeric" returnKeyType="done" maxLength={10} placeholder="Phone Number" value={localPhoneNumber} />

Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label May 20, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants