react / react/react-native

iOS TextInput Component with nested text

Aperta
#30,834 7 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs: Triage :mag: Never gets stale
Lingua principale
C++
Stelle
127k
Fork
25.3k
Merge medio
1g 23h
PR unite (30g)
4

Descrizione

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!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il comportamento di iOS con l’esempio di TextInput annidato, iniziando con testo cinese ed emoji. Ispeziona node_modules/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m, in particolare setAttributedText:. L’attività è completata quando lo stile del testo annidato viene aggiornato correttamente per questi input, preservando il comportamento predefinito previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ios, objective-c, react-native
Ambito
mobile-dev
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.