From 9506e5afc7844a45d3029c209ae5809c5f4c5e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Mon, 1 Feb 2016 14:52:33 -0800 Subject: [PATCH] add animated param in ListView#scrollTo Summary: Since scrollTo(x,y,**animated**) params has been introduced, it was not backported to ListView scrollTo method. Closes https://github.com/facebook/react-native/pull/5661 Reviewed By: svcscm Differential Revision: D2886049 Pulled By: nicklockwood fb-gh-sync-id: 016e92beadc7f397be77b8c58dc572119f873556 --- Libraries/CustomComponents/ListView/ListView.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index fb1210304..e395ee817 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -236,8 +236,8 @@ var ListView = React.createClass({ this.refs[SCROLLVIEW_REF].getScrollResponder(); }, - scrollTo: function(destY, destX) { - this.getScrollResponder().scrollResponderScrollTo(destX || 0, destY || 0); + scrollTo: function(destY, destX, animated = true) { + this.getScrollResponder().scrollResponderScrollTo(destX || 0, destY || 0, animated); }, setNativeProps: function(props) { @@ -472,7 +472,7 @@ var ListView = React.createClass({ this.scrollProperties.visibleLength = visibleLength; this._updateVisibleRows(); this._renderMoreRowsIfNeeded(); - } + } this.props.onLayout && this.props.onLayout(event); }, @@ -495,7 +495,7 @@ var ListView = React.createClass({ this._maybeCallOnEndReached(); return; } - + var distanceFromEnd = this._getDistanceFromEnd(this.scrollProperties); if (distanceFromEnd < this.props.scrollRenderAheadDistance) { this._pageInNewRows();