react / react/react-native

List jumping when sliding using maintainVisibleContentPosition on Android

Abierto
#41,212 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Issue: Author Provided Repro Needs: Triage :mag: Platform: Android
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza ejecutando la flatlist-demo enlazada con React Native 0.72.6 y reproduciendo el salto en Android al deslizarte por mensajes antiguos. Traza el manejo de maintainVisibleContentPosition en Android y compáralo con el comportamiento en iOS. Se considera terminado cuando insertar un mensaje muy largo ya no cambia inesperadamente la posición visible en Android.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react-native
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.