react / react/react-native

[iOS] The scroll position of the multiline TextInput affects the ScrollView auto-scroll when the keyboard opens/closes

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

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

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

説明

Description

On iOS, when using a ScrollView with automaticallyAdjustKeyboardInsets and a multiline TextInput, the scroll position of the TextInput affects how the ScrollView auto-scrolls when the keyboard opens or closes.

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 fixed height and many lines of text (let say 20)
   // More content to allow the ScrollView to scroll if needed
</ScrollView>
  1. ScrollView with automaticallyAdjustKeyboardInsets
  2. Content above the TextInput to fill the screen
  3. Multiline TextInput with fixed height and many lines of text
  4. Content below the TextInput to allow the ScrollView to scroll if needed
  5. Focus on the input and scroll it to the end
  6. Scroll the ScrollView to align the TextInput at the bottom of the screen
  7. Focus on the last line in the TextInput
  8. The keyboard slides up, and the ScrollView scrolls too much
  9. With the keyboard open, scroll the ScrollView to align the TextInput at the bottom of the screen (above the keyboard)
  10. Close the keyboard
  11. The ScrollView scrolls up
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/the-scroll-position-of-the-multiline-textinput-affects-the-scrollview-auto-scroll-when-the-keyboard-opens-or-closes?platform=ios

Screenshots and Videos

https://github.com/user-attachments/assets/1566ea6e-e936-4670-a18a-80090857f58c

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

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

はじめの一歩

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

調査の方向性

必須の iOS Snack reproducer から始め、キーボードを開閉する際の ScrollView と multiline TextInput の動作を比較します。automaticallyAdjustKeyboardInsets の処理を追跡し、その後、キーボードを開いたときに ScrollView が過剰にスクロールせず、閉じたときに上方向へ移動しないことを確認します。

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

評価

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

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

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