react / react/react-native

TextInput value flickers when adding new lines

オープン
#43,363 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

説明

Description

Text inside text input is flickering while going to next line as well as deleting text (video 1)

but problem solved if i give height prop instead of maxHeight to the textinput or specify number of lines (video 2)

code

<TextInput
multiline
onFocus={() => setIsFocused(true)}
underlineColorAndroid={'red'}
style={{
color: colors.text,
// height: 350,
fontSize: 18,
maxHeight: 350,
marginLeft: 5,
width: '100%',
}}
textAlignVertical="top"
spellCheck={false}
onChange={e => setText(e.nativeEvent.text)}>
{txt}

Steps to reproduce
React Native Version

0.73.5

Affected Platforms

Runtime - Android

Output of npx react-native info
info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.22631
  CPU: "(8) x64 AMD Ryzen 3 5300U with Radeon Graphics         "
  Memory: 969.45 MB / 7.33 GB
Binaries:
  Node:
    version: 20.11.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "21"
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-34 | Google APIs Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    Versions:
      - 10.0.19041.0
IDEs:
  Android Studio: AI-222.4459.24.2221.10121639
  Visual Studio: Not Found
Languages:
  Java: 17.0.8
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.5
    wanted: 0.73.5
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
-
Reproducer

snack.expo.dev/@akshaykhapare/carefree-blue-croissant?platform=android

Screenshots and Videos

video 1

https://github.com/facebook/react-native/assets/139696100/89d6f958-aefd-401e-b9dc-40a9f799abd8

video 2

https://github.com/facebook/react-native/assets/139696100/38443aae-2857-47db-b8ec-0047d9dd07fd

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

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

はじめの一歩

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

調査の方向性

この issue ではソースファイルもテストも指定されていません。まずリンクされた Expo Snack を Android で実行し、maxHeight を使用した複数行の TextInput で行を追加または削除しながらちらつきを再現してください。固定の高さや明示的な行数を必要とせずにちらつきがなくなれば完了です。

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

評価

技術スタック
android, react-native
領域
mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
42/100

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

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