Brownfield App `TextInput` not working properly on Samsung devices
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.3k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 4
Descripción
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
- Create a new Android Repository;
- Create a Fragment;
- Embed React Native into this React Fragment;
- Add a TextInput field;
- 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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el reproducer brownfield-rn-fragment enlazado y reproduce el comportamiento de TextInput dentro de un Android Fragment en los dispositivos Samsung indicados. Compara los toques que activan onPressIn pero no onFocus con el caso funcional de Activity/root-view en React Native 0.74.5 y 0.75.3. Se considera terminado cuando todo el TextInput recibe el foco y acepta texto sin llamar a ref.current.focus() desde cada onPressIn.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, react-native
- Área
- mobile
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100