react / react/react-native

Brownfield App `TextInput` not working properly on Samsung devices

Aperta
#46,989 7 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Component: TextInput Issue: Author Provided Repro Newer Patch Available
Lingua principale
C++
Stelle
127k
Fork
25.3k
Merge medio
1g 23h
PR unite (30g)
4

Descrizione

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

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

Inizia con il reproducer brownfield-rn-fragment collegato e riproduci il comportamento di TextInput all'interno di un Android Fragment sui dispositivi Samsung elencati. Confronta i tap che attivano onPressIn ma non onFocus con il caso funzionante Activity/root-view in React Native 0.74.5 e 0.75.3. Il lavoro è completato quando l'intero TextInput riceve il focus e accetta testo senza chiamare ref.current.focus() da ogni onPressIn.

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

Valutazione

Stack tecnologico
android, react-native
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.