react / react/react-native

iOS TextInput Component with nested text

Offen
#30,834 7 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Needs: Triage :mag: Never gets stale
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das iOS-Verhalten mit dem verschachtelten TextInput-Beispiel, beginnend mit chinesischem Text und Emoji. Untersuche node_modules/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m, insbesondere setAttributedText:. Die Aufgabe ist erledigt, wenn der verschachtelte Textstil für diese Eingaben korrekt aktualisiert wird und dabei das erwartete Standardverhalten erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ios, objective-c, react-native
Bereich
mobile-dev
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.