-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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][inverted] SectionSeparatorComponent displays in wrong places with inverted list #18943
Comments
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. |
try |
@yanisakli Just tried it out with |
To clarify the issue here: The section headers need to render before the section items when the SectionList is inverted -- currently when the SectionList is reversed the section headers are placed after each section |
Any updates on this? I'm still getting this issue on the latest version of react native. |
@nastynaz I did implement my own section-list using flatlist and conditional rendering of the current item, poor performance but at least it works. |
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. |
This hasn't been fixed yet. |
…ponent should displays in correct place with inverted list
…ponent should displays in correct place with inverted list
#26933) Summary: SectionSeparatorComponent and ItemSeparatorComponent should displays in the correct place with an inverted list This PR fix issue #18943 Currently, when using SectionSeparatorComponent and ItemSeparatorComponent with an inverted SectionList, the separators will display at the wrong place. Please see issue #18943 for more information. ## Changelog [General] [Fixed] - Fix separators displays in wrong places with the inverted list Pull Request resolved: #26933 Test Plan: before this fix, the following code will result in following screenshots: ``` import React from 'react'; import { StyleSheet, Text, SectionList, SafeAreaView } from 'react-native'; export default function App() { return ( <SafeAreaView style={styles.container}> <SectionList style={{ width: '100%' }} sections={[ { data: ['item 1', 'item 2', 'item 3', 'item 4', 'item 5', 'item 6', 'item 7'] } ]} renderItem={({ item }) => <Text style={{ fontSize: 18, backgroundColor: 'greenyellow', width: '100%' }}>{item}</Text>} inverted SectionSeparatorComponent={() => <Text style={{ fontSize: 28, backgroundColor: 'fuchsia', width: '100%' }}>section separator</Text>} ItemSeparatorComponent={() => <Text style={{ fontSize: 12, backgroundColor: 'gold', width: '100%' }}>item separator</Text>} renderSectionHeader={()=><Text style={{ fontSize: 38, backgroundColor: 'lightpink', width: '100%' }}>section header</Text>} renderSectionFooter={()=><Text style={{ fontSize: 38, backgroundColor: 'lightpink', width: '100%' }}>section footer</Text>} /> </SafeAreaView> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, }); ``` <img width="413" alt="螢幕快照 2019-10-21 下午12 23 36" src="https://user-images.githubusercontent.com/1477985/67176763-030df580-f3fe-11e9-938f-38939339bf5c.png"> after this fix, the separators will display in the right place <img width="414" alt="螢幕快照 2019-10-21 下午12 23 51" src="https://user-images.githubusercontent.com/1477985/67176795-2042c400-f3fe-11e9-96f3-a8ea1cfb28a2.png"> Differential Revision: D18174225 Pulled By: cpojer fbshipit-source-id: 30901e68f38326c69715514a09a7a5130a2332a0
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. |
I will check the latest pr and write back here :) |
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. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Environment
Environment:
OS: macOS High Sierra 10.13.1
Node: 8.6.0
Yarn: 1.5.1
npm: 4.6.1
Watchman: 4.9.0
Xcode: Xcode 9.0.1 Build version 9A1004
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3
Steps to Reproduce
Clone this repository and run it via
react-native run-ios
.Observe the section separators are in wrong (randomly?) places.
Expected Behavior
The section separators should be right after the sections and section headers (like the non-inverted section list does).
I've used the same code as below but without inverted prop.
Expected gif:
Actual Behavior
The section separator components are in wrong places in the list if the list is inverted. For a non-inverted list, it works as expected.
Sample code:
Problem Gif:
The text was updated successfully, but these errors were encountered: