react / react/react-native

TextInput with controled selection clear children when change position

Abierto
#41,966 7 comentarios 4 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Component: TextInput Issue: Author Provided Repro Needs: Triage :mag: Newer Patch Available
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con el reproductor vinculado de jcubic/react-native-text-input y reproduce el fallo de Android usando una selección controlada con children estilizados. Compara el input basado en children con el input basado en value mientras mueves el cursor. Se considera terminado cuando los children estilizados siguen visibles después de cambiar la selección, incluido cuando hay un value inicial.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react-native
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.