react / react/react-native

Inverted FlatList displays activity indicator at the bottom

Abierto
#17,553 47 comentarios 11 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Bug Component: FlatList Good first issue Help Wanted :octocat: Type: Enhancement
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

Environment: all newer environments
Packages: any packages
Target Platform: any platform
Version: 0.53.0 and all other versions of RN that support FlatList with the inverted attribute

Steps to Reproduce
  1. return <FlatList {...props} inverted data={[...]} refreshing={this.state.isLoading} onRefresh={this.someListUpdatingFunction} />
    (just add the 'inverted' attribute to any RN <FlatList/> to reproduce, then try pulling down to refresh, then try pulling up to refresh)
Expected Behavior

onRefresh should allow users to refresh using the most common way that users have been trained to refresh data over the years, which is to "pull down to refresh" and see an ActivityIndicator spinning above the FlatList, never below it... this should be the default even when inverted={true}

Actual Behavior

user has to pull UP to refresh (with Activity Indicator at the bottom) ... literal vs intuitive: when taken "literally", i can agree that this is expected behavior since it is after all "inverted" ... however, when taken "intuitively", it's not so expected, especially for users... I don't think app users have ever been trained to pull up to refresh data, except for maybe in the "OfferUp" chat app!

Most Applicable Use Case
  • a chat app, where users pull down to load more chat history that's appended above, similar to how it's done in iOS Messages app
  • UIs like terminals, event logs, chat, etc... where it's common to insert new content from the bottom and load old content when the user scrolls to the top or pulls down to refresh
Demo

https://snack.expo.io/S1UOyWgSM
(to reproduce, just add the 'inverted' attribute to any RN <FlatList/> component using v0.53.0 or any version of RN that supports FlatList)

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

Reproduce el comportamiento con el punto de entrada de FlatList usando inverted, refreshing y onRefresh, comenzando por el ejemplo de Expo Snack enlazado. Rastrea cómo las listas invertidas posicionan el control de actualización y compara el comportamiento de tirar hacia abajo y tirar hacia arriba entre las plataformas compatibles. Se considera terminado cuando la actualización al tirar hacia abajo muestra el ActivityIndicator encima de la lista, manteniendo al mismo tiempo el caso de uso del chat y la carga del historial.

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
Activo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.