react / react/react-native

iOS TextInput Component with nested text

Ouverte
#30,834 7 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Needs: Triage :mag: Never gets stale
Langage dominant
C++
Étoiles
127k
Forks
25.3k
Merge moyen
1 j 23 h
PR mergées (30 j)
4

Description

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!

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduisez le comportement d’iOS avec l’exemple de TextInput imbriqué, en commençant par du texte chinois et un emoji. Inspectez node_modules/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m, en particulier setAttributedText:. La tâche est terminée lorsque le style de texte imbriqué est correctement mis à jour pour ces entrées, tout en conservant le comportement par défaut attendu.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
ios, objective-c, react-native
Domaine
mobile-dev
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.