Skip to content

Sticky Headers respects contentContainerStyle horizontal padding #2218

@davidfloegel

Description

@davidfloegel

Problem Statement

Using a FlashList with StickyHeaders requires custom work arounds if the FlashList uses contentContainerStyle settings such as paddingHorizontal.

What happens is the headers are rendered correctly in the list (since the horizontal padding is applied), but when they become sticky, they don't "remember" that they should have the same horizontal padding applied.

Proposed Solution

Whenever a header becomes sticky, it should apply the same horizontal padding that the contentContainerStyle has.

Alternatives Considered

If this is not always desired, a custom sectionHeaderContainerProps could be considered that I can configure, though I can't think of use-cases where a user would want the sticky header to jump to a different position than it has in the scrolling view itself.

Priority

  • Critical - Blocking my project
  • High - Significant improvement to my workflow
  • Medium - Would be nice to have
  • Low - Minor enhancement

Checklist

  • I've searched existing issues and discussions
  • I've provided clear use cases for this feature
  • I'm willing to help test this feature if implemented

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-fixAgent should fix this issueenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions