Skip to content

Commit

Permalink
[RFC][ListView] Add getInnerViewNode, scrollTo, scrollWithoutAnimationTo
Browse files Browse the repository at this point in the history
After building some scroll view components (pull-to-refresh, infinite scroll) one of the most important features I found was composition of different scroll views. This diff adds scroll view methods to ListView so that it too acts like a scroll view and can be composed.

This is an RFC because I have another approach that is a little more robust but perhaps more obtuse.
  • Loading branch information
ide committed Apr 30, 2015
1 parent b99744a commit 9823ce8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Libraries/CustomComponents/ListView/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,23 @@ var ListView = React.createClass({
};
},

getInnerViewNode: function() {
return this.refs[SCROLLVIEW_REF].getInnerViewNode();
},

scrollTo: function(destY, destX) {
this.refs[SCROLLVIEW_REF].scrollTo(destY, destX);
},

scrollWithoutAnimationTo: function(destY, destX) {
this.refs[SCROLLVIEW_REF].scrollWithoutAnimationTo(destY, destX);
},

/**
* Provides a handle to the underlying scroll responder to support operations
* such as scrollTo.
*
* Deprecated: instead call scrollTo, etc. directly on this component
*/
getScrollResponder: function() {
return this.refs[SCROLLVIEW_REF];
Expand Down

0 comments on commit 9823ce8

Please sign in to comment.