react / react/react-native

(Android 9) Flatlist header shows up underneath items if items have elevation: 1 or higher; can't be fixed with zindex.

オープン
#49,179 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Component: FlatList Needs: Triage :mag: Platform: Android
主要言語
C++
スター
127k
フォーク
25.3k
平均マージ
1日 23時間
マージ済み PR(30日)
4

説明

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
  1. 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.
  2. scroll the FlatList
  3. 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

Image

Image

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、FlatList、stickyHeaderIndices={[0]}、および elevation を持つ項目を使用して、React Native 0.76.6 の Android 9 でリンクされた Snack を再現し、Android 11 以降と動作を比較します。sticky header と item elevation の Android における処理を追跡し、影響を受ける Android バージョンでスクロール中も header が elevation のある項目より上に留まれば、問題の対応完了とみなします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, react-native
領域
mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。