Brownfield App `TextInput` not working properly on Samsung devices
Personne n'a encore pris cette issue.
- Langage dominant
- C++
- Étoiles
- 127k
- Forks
- 25.3k
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 4
Description
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par le reproducer brownfield-rn-fragment lié et reproduisez le comportement de TextInput dans un Android Fragment sur les appareils Samsung listés. Comparez les taps qui déclenchent onPressIn mais pas onFocus avec le cas fonctionnel Activity/root-view sous React Native 0.74.5 et 0.75.3. C’est terminé lorsque l’ensemble du TextInput reçoit le focus et accepte du texte sans appeler ref.current.focus() depuis chaque onPressIn.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- android, react-native
- Domaine
- mobile
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100