From 33e05a11f00d1455f39b6dfef1c76c4130df02e5 Mon Sep 17 00:00:00 2001 From: Emilio Rodriguez Date: Wed, 6 Jan 2016 10:24:48 -0800 Subject: [PATCH] Added scrollTo method to ListView Summary: Closes https://github.com/facebook/react-native/pull/4781 Reviewed By: svcscm Differential Revision: D2803479 Pulled By: mkonicek fb-gh-sync-id: 7da41eb0bdfb0f90b4f81d1006eaf00446820827 --- Libraries/CustomComponents/ListView/ListView.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index db1cbaee10..9f0ae724e9 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -236,6 +236,10 @@ var ListView = React.createClass({ this.refs[SCROLLVIEW_REF].getScrollResponder(); }, + scrollTo: function(destY, destX) { + this.getScrollResponder().scrollResponderScrollTo(destX || 0, destY || 0); + }, + setNativeProps: function(props) { this.refs[SCROLLVIEW_REF].setNativeProps(props); },