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

[SectionList] SectionList's sticky header dose not work well with 'inverted' option #14520

Closed
freeljt opened this issue Jun 14, 2017 · 37 comments
Labels
Bug Component: SectionList Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@freeljt
Copy link

freeljt commented Jun 14, 2017

Description

When rendering SectionList with 'inverted' option and renderSectionHeader, the sticky header is upside down and sticky to the bottom. (in our App, we want them sticky at top even)

Reproduction Steps

Render SectionList with inverted option and section header.

Sample Code

        <SectionList style={styles.messageList}
                     **inverted**
                     sections={this.getSectionData()}
                     renderSectionHeader={renderSectionHeader}
                     onEndReached={this.props.loadEarlierMsgs}
                     keyExtractor={rowKey}
                     renderItem={this.renderRow} />

Solution

Maybe apply the transform scale -1 to header component and make the section header sticky to the top as well?

Additional Information

  • React Native version: downloaded from master branch on June 14th, 2017
  • Platform: iOS
  • Development Operating System: maxOS
  • Build tools: Xcode
@kholiavko-roman
Copy link

kholiavko-roman commented Jul 28, 2017

@freeljt, I trying to use SectionList with 'inverted={true}', but SectionLIst rendered as default.
Here is my code:

 <SectionList
          renderItem={this.renderItem}
          inverted={true}
          stickySectionHeadersEnabled={true}
          keyExtractor={(item, index) => `message_${index}`}
/>

It is right, in you case inverted SectionList scrolled in different direction ?

@compojoom
Copy link
Contributor

@kholiavko-roman - are you on RN 0.47? It seems that inverted on sectionlist was added there. I was on 0.46 and was wondering what the inverted property is supposed to do as I wasn't seeing any difference.

@freeljt - have you found a solution already? I think that nobody tested this with sectionlist as it's implemented in the VirtualizedList. It doesn't make much sense having the Seactionheader at the bottom, but this is a consequence of the transform that is applied on the whole view

@dralletje
Copy link
Contributor

dralletje commented Sep 26, 2017

I am having the same problem. Sticky headers are not implemented in VirtualizedList either, they are implemented in ScrollView, but even there they work pretty much isolated:

https://github.com/facebook/react-native/blob/master/Libraries/Components/ScrollView/ScrollViewStickyHeader.js

I guess the best way to support everything we need, it making allowing for "sticky footers". Then inverted on VirtualizedList could "just" swap stickyHeaderIndices and stickyFooterIndices.
I also could imagine some people actually needing stickyFooters sometimes.

I wondered "But do we want stickyXXX for everything?!" but figured that there are really only two sides tangent to the scroll direction 🤷‍♀️

I'll try to make stickyFooterIndices based on how stickyHeaderIndices is implemented sometime soon!

@terrysahaidak
Copy link

Anybody has any solution for that?

@stale
Copy link

stale bot commented Dec 15, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 15, 2017
@terrysahaidak
Copy link

Hi there. I think this issue definitely should be open because there is no way in SectionList to use some different scroll view component like ListView does. Since ListView is deprecated and SectionList still has some laggy features, each of them should be fixed. Or ListView support should be continued.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 15, 2017
@diegolmello
Copy link

I'm having the same problem as you can see on Unread header below.

screen shot 2017-12-21 at 13 47 05

@vascogaspar
Copy link

any progress on this?

@Bessonov
Copy link

I think inverted is a workaround for a really common requirement: to build chat-like apps. You don't believe me? Look at any virtualized-list-component for react, react-native and angularjs. This requirement exists for every component. Unfortunately, I can't find any suitable solution, except workarounds with flaws.

The idea to reverse the list is quite cool, but well, that's not really fix the issue with adding elements to top without junks, because it leads to add-to-bottom issue.

I understand, that "virtual-both-directions-scrollable-list-with-dynamic-rows-height-and-you-can-go-to-desired-item" requirement is quite complex. But I can't believe that this is impossible.

For our angularjs-based app we've implemented own solution which works, but it's to specific to our internals.

It would be a killer feature for react/react-native or angular, if one of them supports chat-like virtualized lists.

@hramos hramos added the Lists label Mar 8, 2018
@stijnvanderlaan
Copy link

stijnvanderlaan commented Apr 20, 2018

Would love this.

@stale
Copy link

stale bot commented Jul 19, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 19, 2018
@Bessonov
Copy link

Hey, stale bot, leave it open :)

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 20, 2018
@stale
Copy link

stale bot commented Oct 18, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 18, 2018
@terrysahaidak
Copy link

Stale bot, leave it open as it still exists.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 18, 2018
@stale
Copy link

stale bot commented Jan 20, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 20, 2019
@terrysahaidak
Copy link

And again, it still exists.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 20, 2019
@hramos hramos removed the Bug Report label Feb 6, 2019
@terrysahaidak
Copy link

This hasn't been fixed yet.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 8, 2019
@stale
Copy link

stale bot commented Nov 6, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 6, 2019
@Bessonov
Copy link

Bessonov commented Nov 6, 2019

Activity!

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 6, 2019
@ydv0121
Copy link

ydv0121 commented Jan 8, 2020

+1

@stale
Copy link

stale bot commented Apr 7, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 7, 2020
@iamolegga
Copy link

Yes, it does still require the community's attention

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 7, 2020
@terrysahaidak
Copy link

Seems like it's almost fixed in 0.62.

The only minor problem is it seems like there is unnecessary section separator next to the ListFooterComponent.

image

@irfaan
Copy link

irfaan commented Apr 18, 2020

Seems like it's almost fixed in 0.62.

The only minor problem is it seems like there is unnecessary section separator next to the ListFooterComponent.

image

Nice. How does this look with a short (less than height of viewport) list?

@stale
Copy link

stale bot commented Jul 18, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 18, 2020
@Bessonov
Copy link

further activity occurs

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 18, 2020
@gustperz
Copy link

inverted and invertStickyHeaders work correctly when scrolling, but the first items are not rendered as expected when they are low on items

for this, the header is still represented below the items

this is how it looks when scrolling

@dmarselus
Copy link

dmarselus commented May 11, 2022

use renderSectionFooter instead
thank me later bois

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 1, 2023
@adidoes
Copy link

adidoes commented Mar 4, 2023

can footers be made sticky instead of the headers?

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 4, 2023
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 31, 2023
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Sep 7, 2023
@iamolegga
Copy link

Reopen please

@deniska69
Copy link

deniska69 commented Jul 30, 2024

2024.07.30 - the problem is still relevant.

<FlatList
inverted={true}
stickyHeaderIndices={[0]}
ListHeaderComponent={<StickyHeader />} />

scroll! not sticky!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Component: SectionList Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests