react / react/react-native

TextInput with controled selection clear children when change position

Đang mở
#41,966 7 bình luận 4 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: Newer Patch Available
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

If you have TextInput with styled Text element inside (instead of value) and when you add controlled selection, the children are ignored and you have blank text even when you have initialValue.

Steps to reproduce
  1. Create TextInput with children
  2. Make it controlled selection Input
  3. Change the selection to move the cursor
  4. The children disappear
React Native Version

0.72.6

Affected Platforms

Runtime - Android

Output of npx react-native info
System:
  OS: Linux 6.6 Fedora Linux 39 (Xfce)
  CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Memory: 4.72 GB / 15.28 GB
  Shell:
    version: 5.2.21
    path: /bin/bash
Binaries:
  Node:
    version: 21.2.0
    path: ~/.nvm/versions/node/v21.2.0/bin/node
  Yarn: Not Found
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v21.2.0/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/local/rvm/rubies/ruby-2.6.10/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.6
    wanted: 0.72.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Sorry, I have no idea why it can't find Android Studio and SDK on my system. I have them installed, and updated recently to 2023.1.1 from November 9, 2023.

Stacktrace or Logs
There are no stacktrace with this bug
Reproducer

https://github.com/jcubic/react-native-text-input.git

Screenshots and Videos

The First Input is with children (each line has it's on <Text>) the second is with value.

Peek 2023-12-17 17-56

The same happens when you move the cursor in the bottom Input, the top content disappears.

Peek 2023-12-18 21-32

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 reproducer jcubic/react-native-text-input được liên kết và tái hiện lỗi Android bằng cách sử dụng selection được kiểm soát với các children có style. So sánh input dựa trên children với input dựa trên value trong khi di chuyển con trỏ. Được xem là hoàn tất khi các children có style vẫn hiển thị sau khi selection thay đổi, kể cả khi có value ban đầu.

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.