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
This commit is contained in:
parent
debcac59d0
commit
9506e5afc7
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue