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

[iOS][NewArch] Numeric TextInput not triggering onSubmitEditing #48259

Closed
SimHue7 opened this issue Dec 13, 2024 · 3 comments
Closed

[iOS][NewArch] Numeric TextInput not triggering onSubmitEditing #48259

SimHue7 opened this issue Dec 13, 2024 · 3 comments
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@SimHue7
Copy link

SimHue7 commented Dec 13, 2024

Description

When using the new architecture in React Native on iOS, the onSubmitEditing callback is not triggered for a TextInput component when:

  • keyboardType is set to "numeric"
  • returnKeyType is set to "done"
  • The "Done" button on the keyboard is pressed.

Example Code:
<TextInput placeholder="text-input" keyboardType="numeric" onSubmitEditing={() => console.log("on submit")} returnKeyType="done"/>

Steps to reproduce

  1. Open the snack on iOS platform
  2. Tap into the TextInput
  3. Tap the done button above the onscreen-keyboard
  4. See console output

React Native Version

0.76.3

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer, TurboModule - The New Native Module System

Output of npx react-native info

System:
  OS: macOS 14.6.1
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 29.66 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.15.0
    path: ~/.nvm/versions/node/v20.15.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.15.0/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.15.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.14.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.1
      - 34.0.0
      - 35.0.0
    System Images:
      - android-31 | Google Play Intel x86_64 Atom
      - android-34 | Google APIs Intel x86_64 Atom
      - android-34 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12700392
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.3
    wanted: latest
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.3
    wanted: 0.76.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

no logs

Reproducer

https://snack.expo.dev/@simhue7/2a886d?platform=ios

Screenshots and Videos

No response

@SimHue7 SimHue7 added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Dec 13, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.76.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot react-native-bot added Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. labels Dec 13, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@zhongwuzw
Copy link
Contributor

Hi ,may fix in #48276

@migueldaipre migueldaipre added Resolution: PR Submitted A pull request with a fix has been provided. and removed Needs: Triage 🔍 labels Dec 16, 2024
robhogan pushed a commit that referenced this issue Dec 30, 2024
Summary:
Fixes #48259 . The paper code like :
https://github.com/facebook/react-native/blob/2fee13094b3d384c071978776fd8b7cff0b6530f/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm#L777-L784

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Numeric TextInput not triggering onSubmitEditing

Pull Request resolved: #48276

Test Plan: Repro in #48259

Reviewed By: cipolleschi

Differential Revision: D67274739

Pulled By: javache

fbshipit-source-id: 57396c6e1a8ef96a1b29cae4a9aa9b5f48f6080b
@cortinico cortinico added Resolution: Fixed A PR that fixes this issue has been merged. and removed Resolution: PR Submitted A pull request with a fix has been provided. Newer Patch Available labels Jan 2, 2025
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. Resolution: Fixed A PR that fixes this issue has been merged. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants