Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: First Sticky Header component renders on top of ListHeaderComponent on mount, disappears on scroll #727

Open
1 of 2 tasks
chvanlennep opened this issue Jan 4, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@chvanlennep
Copy link

chvanlennep commented Jan 4, 2023

Current behavior

On iOS, when stickyHeaderIndices are used together with ListHeaderComponent, the first sticky header component renders over the ListHeaderComponent, as well as in its expected position on mount. It then disappears on scroll.

Simulator.Screen.Recording.-.iPhone.14.-.2023-01-04.at.11.05.10.mp4

Expected behavior

Sticky headers should not be duplicated.

To Reproduce

This is a minimal repo which demonstrates the bug (note that is intermittent, you may have to reload a few times):

https://github.com/chvanlennep/flashlistheaders-demo

Platform:

  • iOS
  • Android

Environment

"dependencies": { "@shopify/flash-list": "^1.4.0", "react": "18.0.0", "react-native": "0.69.5" }

@chvanlennep chvanlennep added the bug Something isn't working label Jan 4, 2023
@mjvestal
Copy link

I ran into this issue. I am getting around it by adding an item to the list data that represents what I want to render as the ListHeaderComponent and instead rendering the header in renderItem.

So in my case this works:

data=[
  { type: 'header' }, // renderItem renders ListHeaderComponent
  { type: 'thing-that-sticks },
  {
     type: 'data-item',
     ...
   }, // many of these
]
stickyHeaderIndices={[1]}

But what I'd expect to work, doesn't

data=[
  { type: 'thing-that-sticks },
  {
     type: 'data-item',
     ...
   }, // many of these
]
stickyHeaderIndices={[0]}
ListHeaderComponent={ListHeaderComponent}

@GregoryNative
Copy link

Hey, any updates on that?

@KarlosQ
Copy link

KarlosQ commented Nov 6, 2023

This keeps happening (RN 0.72.6 & 1.6.2)

@iway1
Copy link

iway1 commented Dec 17, 2023

if this isn't gonna be fixed soon maybe add a warning that stickyHeaderIndices and ListHeaderComponent are incompatibles people don't ship this bug by mistake

@lsarni
Copy link

lsarni commented Jul 23, 2024

We are having the same problem on Android on ^1.7.0

@MaxTheTurtle0
Copy link

Did anyone find a workaround/fix yet?

@programng
Copy link

Also having this issue. Wondering if anyone found a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants