-
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
Inverted scrollsToTop scrolls to bottom #21126
Comments
This has been an annoying UX issue since I started using React Native ~10 months ago, would be a really great fix for being able to quickly scroll to the top of a chat screen or other |
It seems to me that you are using Expo, so I suggest you open a dedicated issue there 🤷♂️ Our can you reproduce on a new |
Tested with the same code from the snack on a new |
Have you found any workaround while it's getting fixed? |
This PR should fix it: #27574 |
… top (facebook#27574) Summary: React Native ScrollViews are flipped upside down when the prop inverted is set to true. This is the root of a bug: tapping on the status bar in iOS should scroll the Flatlist up to the top but currently it does to the bottom. The solution proposed is to detect natively if the ScrollView is inverted, on such case, prevent it from scrolling it to the beginning of the ScrollView (as a non-inverted ScrollView would do) and force a scroll to the end of it. I've been careful enough not to force the scroll if the user explicitly selected not to do it or if it's happening in a nested ScrollView, as it is the default behaviour in iOS. Fixes facebook#21126 ## Changelog [iOS] [Fixed] - Inverted ScrollViews scroll to their bottom when the status bar is pressed Pull Request resolved: facebook#27574 Test Plan: - on iOS, add a ScrollView and put enough content to overflow the screen size so it can be scrolled - add the prop `inverted={true}` to the ScrollView - go to the screen the Scrollview is in and press the status bar - it should scroll to top (previously it scrolled to the bottom) ![v](https://user-images.githubusercontent.com/807710/71188640-a0ac6680-2281-11ea-91a7-d1e46aba8b14.gif) Differential Revision: D19185270 Pulled By: hramos fbshipit-source-id: 5445093ff38f4ba4082f1d883d8ed087e9565eaf
Environment
Description
When a FlatList has both
scrollsToTop
andinverted
enabled, tapping on the iOS status bar scrolls to the bottom of the list, which isn't a behavior I've seen in any native apps. It would be great if this was either changed or it was possible to do e.g.scrollsToBottom={true}
orscrollsToTopDirection={'inverted'}
.Reproducible Demo
Expo Snack
The text was updated successfully, but these errors were encountered: