(Android 9) Flatlist header shows up underneath items if items have elevation: 1 or higher; can't be fixed with zindex.
Chưa có ai nhận issue này.
- 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
Flatlist ListHeaderComponent together with stickyHeaderIndices={[0]} shows up under items when scrolling, if items have elevation 1 or higher. Seems to only show up on my older device (Android 9), I've tried to fix this with both zIndex and elevation on the header component (also with ListHeaderComponentStyle) but nothing changes.
Steps to reproduce
- open the provided snack with an older device (Android 9), I can't test Android 10 at the moment but when using Android 11 or higher the issue doesn't show up.
- scroll the FlatList
- observe header component
React Native Version
0.76.6
Affected Platforms
Runtime - Android
Output of npx react-native info
System:
OS: Windows 10
Memory: 4.22 GB / 15.9 GB
Binaries:
Node:
version: 20.11.0
path: ~\node_modules\.bin\node.CMD
Yarn: Not Found
npm:
version: 11.0.0
path: ~\project\node_modules\.bin\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "33"
- "35"
Build Tools:
- 33.0.1
- 34.0.0
- 35.0.0
System Images: Not Found
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: AI-241.18034.62.2412.12266719
Visual Studio:
- 17.9.34728.123 (Visual Studio Community 2022)
Languages:
Java: 17.0.13
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 15.1.3
wanted: ^15.1.3
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.6
wanted: 0.76.6
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Stacktrace or Logs
no stacktrace.
Reproducer
https://snack.expo.dev/@0xirakli/lonely-blue-cake?platform=android
Screenshots and Videos
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- 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 tái hiện Snack được liên kết trên Android 9 với React Native 0.76.6, sử dụng FlatList, stickyHeaderIndices={[0]} và các item có độ nâng; so sánh hành vi với Android 11 trở lên. Theo dõi cách Android xử lý sticky header và độ nâng của item, đồng thời coi issue là hoàn tất khi header vẫn nằm phía trên các item được nâng trong lúc cuộn trên các phiên bản Android bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android, react-native
- Lĩnh vực
- mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100