react / react/react-native

Brownfield App `TextInput` not working properly on Samsung devices

オープン
#46,989 コメント 7 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Component: TextInput Issue: Author Provided Repro Newer Patch Available
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされている brownfield-rn-fragment reproducer から開始し、記載されている Samsung デバイス上の Android Fragment 内で TextInput の動作を再現します。onPressIn は発火するが onFocus は発火しないタップと、React Native 0.74.5 および 0.75.3 における動作する Activity/root-view のケースを比較します。完了の条件は、各 onPressIn から ref.current.focus() を呼び出さなくても、TextInput 全体にフォーカスが移り、テキストを入力できることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, react-native
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。