-
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
invertedStickyHeaders not working on iOS as of 0.54.2 #18471
Comments
@janicduplessis who implemented invertStickyHeaders |
We changed this behaviour recently (sorry if it wasn't properly documented), now sticky headers will always stick at the top of the list even when inverted. You can restore the previous behaviour by using cc @sahrens |
Also the name invertStickyHeaders is a bit misleading here, what this prop does is render the headers at the bottom of the ScrollView instead of at the top but since the list is inverted it will appear at the top again. In your case you want invertStickyHeaders to be false since it will cause the sticky headers to appear at the bottom when inverted. |
Most all props should just get forwarded through to the underlying ScrollView, no? |
@sahrens no, for some reason it reads "this.props.inverted" instead of the actual prop when passing props to the ScrollView:
@janicduplessis, is there anything else to propagating invertStickyHeaders besides changing the line above? |
No this should be the only change needed |
invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in facebook#18471
Summary: invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in #18471 Fixes #18471 Pass "invertStickyHeaders: false" to a SectionList (or FlatList), and expect that your sticky headers stick to the bottom of the ScrollView, instead of the top. none [ANDROID] [BUGFIX] [SectionList] - invertStickyHeaders can now be set from SectionList or FlatList. Closes #18524 Differential Revision: D7386163 Pulled By: hramos fbshipit-source-id: 3b66dfca280e657303f69f98c5a8bc0df033f9f7
Summary: invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in facebook#18471 Fixes facebook#18471 Pass "invertStickyHeaders: false" to a SectionList (or FlatList), and expect that your sticky headers stick to the bottom of the ScrollView, instead of the top. none [ANDROID] [BUGFIX] [SectionList] - invertStickyHeaders can now be set from SectionList or FlatList. Closes facebook#18524 Differential Revision: D7386163 Pulled By: hramos fbshipit-source-id: 3b66dfca280e657303f69f98c5a8bc0df033f9f7
Summary: invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in facebook#18471 Fixes facebook#18471 Pass "invertStickyHeaders: false" to a SectionList (or FlatList), and expect that your sticky headers stick to the bottom of the ScrollView, instead of the top. none [ANDROID] [BUGFIX] [SectionList] - invertStickyHeaders can now be set from SectionList or FlatList. Closes facebook#18524 Differential Revision: D7386163 Pulled By: hramos fbshipit-source-id: 3b66dfca280e657303f69f98c5a8bc0df033f9f7
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 8.9.4
Yarn: 1.5.1
npm: 5.6.0
Watchman: Not Found
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0-alpha.2
react-native: 0.54.2 => 0.54.2
Steps to Reproduce
Create a section list and set invertStickyHeaders=true. See:
Expected Behavior
Sticky headers render at the bottom of the screen and stick to the bottom when scrolling.
Actual Behavior
Sticky headers continue to render at the top, and do not stick to the bottom. They also seem to
screw up rendering of the list in general with empty components where there should be headers:
This appears to be a regression in 0.54.2 (it did not exist in 0.52.0). Also, the sticky headers were
always behaving as I expected in 0.52.0. I have an inverted sectionList and the headers were stuck
to the bottom and worked fine.
Edit: I originally reported this as iOS only. It is happening on both iOS and Android.
The text was updated successfully, but these errors were encountered: