react / react/react-native

[TextInput] input cannot be controlled

Đang mở
#34,437 10 bình luận 5 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Component: TextInput Issue: Author Provided Repro Needs: Triage :mag: Never gets stale
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

TextInput value cannot be controlled. Given the following JSX, I expected that typing in the input would do nothing to match behaviour on web:

<TextInput value="" />

Actual behaviour

The value typed by the user flickers on screen before being removed.

https://user-images.githubusercontent.com/175330/185148394-c13e74b7-1319-4948-ae1c-38968a651aa7.MP4

Version

0.70.0-rc.2

Output of npx react-native info

System:
OS: macOS 12.5
CPU: (10) arm64 Apple M1 Max
Memory: 108.61 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.7.0 - /usr/local/bin/node
Yarn: Not Found
npm: 8.15.0 - /usr/local/bin/npm
Watchman: 2022.08.15.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.16 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce
  • Open snack at https://snack.expo.dev/YtYVsPnOU
  • Click iOS (or Android, although it's more intermittent there)
  • Type in the input and note that your value flickers in before being removed
Snack, code example, screenshot, or link to a repository

https://snack.expo.dev/YtYVsPnOU

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.

Hướng nghiên cứu

Bắt đầu với việc tái hiện trên Snack và hành vi giá trị được kiểm soát của TextInput trên iOS và Android. Xác nhận rằng việc nhập khi value="" khiến nội dung nhấp nháy trước khi bị xóa, sau đó lần theo phần triển khai TextInput liên quan và bổ sung phạm vi kiểm thử cho hành vi đầu vào được kiểm soát như mong đợi. Hoàn tất khi đầu vào không còn hiển thị thoáng qua văn bản đã nhập trên cả hai nền tảng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react-native
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.