[SectionList] scrollToLocation scrolls past content on iOS
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: macOS High Sierra 10.13.3 Node: 8.2.1 Yarn: 0.27.5 npm: 5.3.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.3 => 0.53.3
Steps to Reproduce
Implement a SectionList
and use scrollToLocation
to scroll to the last section.
Expected Behavior
It scrolls to the last section, while making sure it doesn’t scroll past the content. On Android this works as expected:
Actual Behavior
On iOS scrollToLocation
scrolls to far:
This also introduces some weird issues when the user starts scrolling from there on.
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:6 (2 by maintainers)
Top Results From Across the Web
react native - scrollToLocation to top for sectionList scrolls past top ...
ScrollToLocation to top for sectionList scrolls to blank page that past very top items. I just want to scroll to very top items,...
Read more >SectionList - React Native
Internal state is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item...
Read more >Help with scrollToLocation in a large SectionList : r/reactnative
When they click on a letter it is meant to scroll and bring them to that section. Much like how the native Iphone...
Read more >react-native-keyboard-aware-scroll-view - npm
A React Native ScrollView component that resizes when the keyboard appears.. Latest version: 0.9.5, last published: a year ago.
Read more >Reactjs – Crash when doing scrollToLocation on SectionList ...
We have an edge case in our app. After the UI is rendered and the user tries to scroll to a section it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Got the same issue on IOS. After fiddling around I found a temporary solution for my app:
After this the
scrollToLocation
works as expected. Let me know if this works for others tooThis issue is still relevant to RN 0.55.4
https://snack.expo.io/@jpunt/scrolltolocation