react / react/react-native

[iOS] The caret goes under the keyboard in multiline TextInput after the ScrollView auto-scrolls to the caret

オープン
#52,414 コメント 8 件 リアクション 2 件 担当者 0 名 GitHub で見る

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

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

説明

Description

On iOS, when using a multiline TextInput inside a ScrollView with automaticallyAdjustKeyboardInsets, the caret goes under the keyboard after adding a new line in the input.

Steps to reproduce
<ScrollView automaticallyAdjustKeyboardInsets>
   // Any content above the TextInput to position it at the bottom of the screen
   <TextInput multiline style={{ height: 100 }} /> // multiline TextInput with some fixed height
</ScrollView>
  1. ScrollView with automaticallyAdjustKeyboardInsets (with enough content to fill the whole screen).
  2. Multiline TextInput with fixed height (let's say 100).
  3. Focus on the input when it’s positioned at the bottom of the screen.
  4. Let the keyboard slide up and the ScrollView scroll to the caret.
  5. Type more than 1 line in the TextInput.
  6. The TextInput caret goes under the keyboard
  7. Once the TextInput fills the available height, it starts scrolling, but the user only sees the first line of the input
React Native Version

0.79.5

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
This is not relevant
Stacktrace or Logs
This is not relevant
MANDATORY Reproducer

https://snack.expo.dev/@serge0n/textinput-multiline-autoscroll-on-new-line?platform=ios

Screenshots and Videos

https://github.com/user-attachments/assets/954d5545-3d89-4ef2-91d8-15214b4fffbe

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

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

はじめの一歩

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

調査の方向性

まず、リンクされている Snack の再現手順を iOS で実行し、ScrollView の automaticallyAdjustKeyboardInsets と複数行の TextInput の間の相互作用を追跡します。新しい行を入力する前後でキャレットの表示状態を比較します。入力が埋まっていくときにキャレットがキーボードより上に留まり、表示されるテキストがキャレットに追従すれば完了です。

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

評価

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

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

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