Skip to content

Support sticky headers for inverted Lists - #17762

Closed
janicduplessis wants to merge 3 commits into
react:masterfrom
janicduplessis:inverted-sticky-headers
Closed

janicduplessis wants to merge 3 commits into
react:masterfrom
janicduplessis:inverted-sticky-headers

Conversation

@janicduplessis

Copy link
Copy Markdown
Contributor

Motivation

Sticky headers for inverted lists should still stick at the top of the list instead of the bottom.

Test Plan

Tested by adding the inverted prop to the SectionList example in RNTester.

Related PRs

It does add a prop to ScrollView but it's very specific to the inverted list implementation, not sure if it should be documented.

Release Notes

[GENERAL][ENHANCEMENT][LISTS] - Support sticky headers for inverted Lists

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. cla signed labels Jan 28, 2018
@pull-bot

pull-bot commented Jan 28, 2018 •

Copy link
Copy Markdown

@facebook-github-bot label Core Team

Generated by 🚫 dangerJS

},

_handleLayout: function(e: Object) {
if (this.props.invertStickyHeaders) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast path here since we only need the height of the ScrollView for the inverted case which is pretty rare.

@sahrens sahrens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, thanks @janicduplessis!

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Jan 28, 2018

@facebook-github-bot facebook-github-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sahrens is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@janicduplessis

Copy link
Copy Markdown
Contributor Author

@sahrens Might need to re-import there was a flow error.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification.

@facebook-github-bot facebook-github-bot added Import Failed Import Started This pull request has been imported. This does not imply the PR has been approved. and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Jan 29, 2018

@facebook-github-bot facebook-github-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sahrens is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@janicduplessis

Copy link
Copy Markdown
Contributor Author

@sahrens Now I'm waiting for that blog post 😄

@terrysahaidak

Copy link
Copy Markdown

Hi @janicduplessis, now headers stick for the top instead of the bottom, but still, they are footers but not headers. Should I do some extra setup to fix it?

@brunoro

brunoro commented Jan 15, 2019

Copy link
Copy Markdown

Is this making it into upstream anytime soon? I just stumbled across this exact use case.

@hramos hramos added the Merged This PR has been merged. label Mar 8, 2019
@react-native-bot react-native-bot removed the Import Started This pull request has been imported. This does not imply the PR has been approved. label Mar 8, 2019
@DinoZenka

Copy link
Copy Markdown

Hi @janicduplessis, now headers stick for the top instead of the bottom, but still, they are footers but not headers. Should I do some extra setup to fix it?

@terrysahaidak, did you found a solution how to make sticky headers stick to the top in inverted section list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants