react / react/react-native

List jumping when sliding using maintainVisibleContentPosition on Android

Đang mở
#41,212 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Issue: Author Provided Repro Needs: Triage :mag: Platform: Android
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

I use maintainVisibleContentPosition in the chat list. When sliding to view older chat messages, if a new message (Especially very long messages, exceeding the height of the screen) is inserted into the list, the (android) list will jump, but iOS will not.

I can reproduce it using the latest RN 0.72.6 and wrote a demo.

https://github.com/Rays15/flatlist-demo

https://github.com/facebook/react-native/assets/17613135/d8872f9c-489e-4b83-bcbf-4205191504b7

@janicduplessis Can this be fixed?

React Native Version

0.72.6

Output of npx react-native info

System:
OS: macOS 14.0
CPU: (12) arm64 Apple M2 Max
Memory: 1.95 GB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 16.15.1
path: ~/.nvm/versions/node/v16.15.1/bin/node
Yarn:
version: 1.22.19
path: ~/.nvm/versions/node/v16.15.1/bin/yarn
npm:
version: 8.11.0
path: ~/.nvm/versions/node/v16.15.1/bin/npm
Watchman:
version: 2023.08.14.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10406996
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.20
path: /Users/rays/.sdkman/candidates/java/current/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.6
wanted: 0.72.6
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Steps to reproduce

https://github.com/Rays15/flatlist-demo

Snack, screenshot, or link to a repository

https://github.com/Rays15/flatlist-demo

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 bằng cách chạy flatlist-demo được liên kết với React Native 0.72.6 và tái hiện hiện tượng nhảy trên Android khi cuộn qua các tin nhắn cũ hơn. Theo dõi cách Android xử lý maintainVisibleContentPosition và so sánh với hành vi trên iOS. Hoàn thành khi việc chèn một tin nhắn rất dài không còn làm thay đổi vị trí hiển thị một cách bất ngờ trên Android.

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

Đánh giá

Công nghệ
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
35/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.