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.

Aperta
#49,179 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Component: FlatList Needs: Triage :mag: Platform: Android
Lingua principale
C++
Stelle
127k
Fork
25.3k
Merge medio
1g 23h
PR unite (30g)
4

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo lo Snack collegato su Android 9 con React Native 0.76.6, usando FlatList, stickyHeaderIndices={[0]} ed elementi con elevazione; confronta il comportamento con Android 11 o versioni successive. Traccia la gestione Android dello sticky header e dell'elevazione degli elementi, e considera completato il problema quando l'header rimane sopra gli elementi con elevazione durante lo scorrimento nelle versioni di Android interessate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, react-native
Ambito
mobile-dev
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.