react / react/react-native

TextInput with controled selection clear children when change position

オープン
#41,966 コメント 7 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Component: TextInput Issue: Author Provided Repro Needs: Triage :mag: Newer Patch Available
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされた jcubic/react-native-text-input の再現コードから始め、スタイル付きの children を使った制御された selection で Android の失敗を再現します。カーソルを移動しながら、children ベースの input と value ベースの input を比較します。selection の変更後も、initial value がある場合を含めて、スタイル付きの children が表示されたままになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react-native
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。