Skip to content

Commit 010f811

Browse files
committed
[RFC][ListView] Add getInnerViewNode, scrollTo, scrollWithoutAnimationTo
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.
1 parent abea586 commit 010f811

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Libraries/CustomComponents/ListView/ListView.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,23 @@ var ListView = React.createClass({
198198
};
199199
},
200200

201+
getInnerViewNode: function() {
202+
return this.refs[SCROLLVIEW_REF].getInnerViewNode();
203+
},
204+
205+
scrollTo: function(destY, destX) {
206+
this.refs[SCROLLVIEW_REF].scrollTo(destY, destX);
207+
},
208+
209+
scrollWithoutAnimationTo: function(destY, destX) {
210+
this.refs[SCROLLVIEW_REF].scrollWithoutAnimationTo(destY, destX);
211+
},
212+
201213
/**
202214
* Provides a handle to the underlying scroll responder to support operations
203215
* such as scrollTo.
216+
*
217+
* Deprecated: instead call scrollTo, etc. directly on this component
204218
*/
205219
getScrollResponder: function() {
206220
return this.refs[SCROLLVIEW_REF];

0 commit comments

Comments
 (0)