react / react/react-native

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

Đang mở
#52,416 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

API: Keyboard Component: ScrollView Component: TextInput Issue: Author Provided Repro
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với reproducer iOS Snack bắt buộc và so sánh hành vi của ScrollView và multiline TextInput khi mở và đóng bàn phím. Theo dõi cách xử lý automaticallyAdjustKeyboardInsets, sau đó xác minh rằng ScrollView không còn cuộn quá xa khi mở bàn phím hoặc dịch lên trên khi đóng bàn phím.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
ios, react-native
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.