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

ListHeaderComponent should not be considered the top of a list view? #18083

Closed
Dexwell opened this issue Feb 25, 2018 · 1 comment
Closed

ListHeaderComponent should not be considered the top of a list view? #18083

Dexwell opened this issue Feb 25, 2018 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot. Type: Enhancement A new feature or enhancement of an existing feature.

Comments

@Dexwell
Copy link

Dexwell commented Feb 25, 2018

Is this a bug report?

Depends on whether this is intended behavior.

Have you read the Contributing Guidelines?

Yes.

Environment

Environment:
OS: macOS High Sierra 10.13.3
Node: 9.4.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: ^0.53.0 => 0.53.0

Target Platform: iOS (11.2)

Steps to Reproduce

  1. Create a SectionList
  2. Add a ListHeaderComponent to the SectionList

Expected Behavior

The ListHeaderComponent would initially be hidden, and would only be revealed by scrolling up, similar to a search or filter bar on iOS. Scrolling to the top of the list (for example by tapping the status bar) would scroll to the top of the first item in the list, not to the top of the header component.

Actual Behavior

The ListHeaderComponent is rendered as if it were the first item in the list, and tapping the status bar scrolls to the top of the header component. I assume this is not the intended behavior, since the same can be achieved by using a different section on top of the list view with its own renderItem function. If the ListHeaderComponent is implemented the way I expected, it would make it much easier to implement custom search bars, filter bars, and the like.

Reproducible Demo

https://snack.expo.io/BJDvzFwBz

@hramos
Copy link
Contributor

hramos commented Mar 13, 2018

It does not look like the component is meant to behave in the way you expect it to. The docs only claim it will be rendered at the top of all other items: https://facebook.github.io/react-native/docs/flatlist.html#listheadercomponent

Closing as the issue does not appear to describe a bug.

@hramos hramos closed this as completed Mar 13, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Mar 13, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 13, 2019
@hramos hramos added the Type: Enhancement A new feature or enhancement of an existing feature. label Mar 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

3 participants