react / react/react-native

Inverted FlatList displays activity indicator at the bottom

Đang mở
#17,553 47 bình luận 11 reaction 0 người được giao Xem trên GitHub

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

Bug Component: FlatList Good first issue Help Wanted :octocat: Type: Enhancement
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ả

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)

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

Tái hiện hành vi với entry point FlatList bằng cách sử dụng inverted, refreshing và onRefresh, bắt đầu từ ví dụ Expo Snack được liên kết. Theo dõi cách các danh sách đảo ngược định vị control làm mới và so sánh hành vi kéo xuống và kéo lên giữa các nền tảng được hỗ trợ. Hoàn thành khi thao tác kéo xuống để làm mới hiển thị ActivityIndicator phía trên danh sách, đồng thời vẫn duy trì use case trò chuyện và tải lịch sử.

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
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/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.