react / react/react-native

TextInput keyboard getting dismissed automatically

Đang mở
#45,798 7 bình luận 2 reaction 1 người được giao Xem trên GitHub

@coado đang làm issue này rồi.

Từ ngày 5/8/2024.

API: Keyboard Component: TextInput Issue: Author Provided Repro Type: New Architecture
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

When a TextInput is wrapped with a View, and the View is given conditional styles based on the focus state of the TextInput, the keyboard gets dismissed as soon as it is tapped to gain focus. So, as soon as onFocus is called, onBlur is triggered automatically. Note that this is not happening for all style keys, but I have encountered it only for "elevation" and "shadowColor" properties till now.

The issue is only happening when new architecture is enabled on both android and ios.

Steps to reproduce

Here is a minimum reproducible example for the issue: https://github.com/1880akshay/RN_NewArch_TextInput

React Native Version

0.74.3

Affected Platforms

Runtime - Android, Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx react-native info
System:
  OS: macOS 13.6.7
  CPU: (10) arm64 Apple M1 Max
  Memory: 204.98 MB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.19.0
    path: ~/.nvm/versions/node/v18.19.0/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v18.19.0/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v18.19.0/bin/npm
  Watchman:
    version: 2024.07.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10406996
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.3.0
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: true
Stacktrace or Logs
-
Reproducer

https://github.com/1880akshay/RN_NewArch_TextInput

Screenshots and Videos

https://github.com/user-attachments/assets/7a70be20-4d74-4da1-9b07-aae8472f0a60

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.