react / react/react-native

iOS TextInput Component with nested text

Abierto
#30,834 7 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Needs: Triage :mag: Never gets stale
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

I have reported before (link) but no response and issue has been closed.

Description:

Hi there! I have just found a bug on iOS multiple TextInput with using nested text display, which not able to have the correct style in some special cases. (Android works fine with the same code.)
As I need to have different style for different text in the same the text input box, nested text is applied instead of changing the style in TextInput

React Native version: 0.61

Steps To Reproduce

  1. Start editing
  2. Type Chinese / Emoji FIRST
  3. type other wordings

Results

Start with Chinese wordings: style will be update after typing english / number
Start with Emoji: style won't be update

Expected Results

wordings will be having the style set, but still in default style

Code example:

<TextInput
   onChangeText={text => {
              this.setState({
                text
              })
            }}
>
   <Text style={{ color: 'red' }}>{this.state.text}</Text>
</TextInput>

Screenshot:

Normal case
image

Error case in which start with Chinese
image

Resume after typing english / number
image

Error case in which start with Emoji
image

I have a quick study and find that - (void)setAttributedText:(NSAttributedString *)attributedText from /node_modules/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m is not called in the following case.

Thanks for your time and hope to hear feedbacks from your team!

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

Reproduce el comportamiento de iOS con el ejemplo de TextInput anidado, comenzando con texto chino y emoji. Inspecciona node_modules/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m, especialmente setAttributedText:. La tarea estará completada cuando el estilo de texto anidado se actualice correctamente para estas entradas, conservando el comportamiento predeterminado esperado.

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

Evaluación

Stack tecnológico
ios, objective-c, react-native
Área
mobile-dev
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.