Please sign in to comment.
Add scrollToEnd to ScrollView and ListView
Summary: **Motivation** A basic task of making a React Native ScrollView or ListView scroll to the bottom is currently very hard to accomplish: - #8003 - #913 - http://stackoverflow.com/questions/29829375/how-to-scroll-to-bottom-in-react-native-listview **NOTE:** If you're building something like a chat app where you want a ListView to keep scrolling to the bottom at all times, it's easiest to use the [react-native-invertible-scrollview](https://github.com/exponent/react-native-invertible-scroll-view) component rather calling `scrollToEnd` manually when layout changes. The invertible-scrollview uses a clever trick to invert the direction of the ScrollView. This pull request adds a `scrollToEnd` method which scrolls to the bottom if the ScrollView is vertical, to the right if the ScrollView is horizontal. The implementation is based on this SO answer: http://stackoverflow.com/questions/952412/uiscrollview-scrol Closes #12088 Differential Revision: D4474974 Pulled By: mkonicek fbshipit-source-id: 6ecf8b3435f47dd3a31e2fd5be6859062711c233
- Loading branch information...
Showing with 148 additions and 12 deletions.
- +10 −0 Examples/UIExplorer/js/ScrollViewExample.js
- +29 −3 Libraries/Components/ScrollResponder.js
- +36 −4 Libraries/Components/ScrollView/ScrollView.js
- +23 −0 Libraries/CustomComponents/ListView/ListView.js
- +4 −4 React/Base/RCTModuleMethod.m
- +26 −1 React/Views/RCTScrollView.m
- +15 −0 React/Views/RCTScrollViewManager.m
- +5 −0 React/Views/RCTScrollableProtocol.h