react / react/react-native

Brownfield App `TextInput` not working properly on Samsung devices

Offen
#46,989 7 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Component: TextInput Issue: Author Provided Repro Newer Patch Available
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

Description

In the midst of developing a chat app using brownfield react native app, an user reported with a video that it was not able to send a message. Upon further investigation I could scope down and reproduce the issue with the following criteria:

  • Brownfield React Native App inside an Android Fragment;
  • Samsung Devices:
    • Note 10;
    • S21 Ultra (Android 14 | OneUI 6.1).

I also tested on my Google Pixel 3a and it worked without any issues, so it must be Samsung related. Also, if the Android app opens an Activity that starts a react root view, the input also does work.

The cases where I could make it work were when I tapped in the corner of the TextInput. Adding console logs to the TextInput, the onPressIn triggers anywhere on the TextInput but onFocus only triggers on the cases that I could make it work.

My fix is not an ideal one, but I am calling ref.current.focus() for every onPressIn in order to make the whole TextInput clickable

Steps to reproduce
  1. Create a new Android Repository;
  2. Create a Fragment;
  3. Embed React Native into this React Fragment;
  4. Add a TextInput field;
  5. Tap and add a text [ NOT WORKING]
React Native Version

Tested on 0.74.5 and 0.75.3

Affected Platforms

Runtime - Android

Output of npx react-native info
not able to run the command
Stacktrace or Logs
no visible crash
Reproducer

https://github.com/gmantuanrosa/brownfield-rn-fragment/tree/main

Screenshots and Videos

This was not tested on the new architecture

https://github.com/user-attachments/assets/f2dfd3ba-5fec-4bfb-b187-7f4e0bdd3090

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

Beginne mit dem verknüpften brownfield-rn-fragment-Reproducer und reproduziere das Verhalten von TextInput innerhalb eines Android Fragment auf den aufgeführten Samsung-Geräten. Vergleiche Taps, die onPressIn, aber nicht onFocus auslösen, mit dem funktionierenden Activity/root-view-Fall unter React Native 0.74.5 und 0.75.3. Erledigt bedeutet, dass das gesamte TextInput den Fokus erhält und Text akzeptiert, ohne ref.current.focus() aus jedem onPressIn aufzurufen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, react-native
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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