Skip to content

Commit

Permalink
Support custom ScrollView implementations in ListView
Browse files Browse the repository at this point in the history
Summary: See e9f64b2#commitcomment-16166567

Reviewed By: tadeuzagallo

Differential Revision: D2953787

fb-gh-sync-id: b8978b3fa6ae9e848be918cc707335a06ea56cf6
shipit-source-id: b8978b3fa6ae9e848be918cc707335a06ea56cf6
  • Loading branch information
nicklockwood authored and facebook-github-bot-5 committed Feb 19, 2016
1 parent 44ea74c commit b516976
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Libraries/CustomComponents/ListView/ListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,18 @@ var ListView = React.createClass({

/**
* Provides a handle to the underlying scroll responder.
* Note that the view in `SCROLLVIEW_REF` may not be a `ScrollView`, so we
* need to check that it responds to `getScrollResponder` before calling it.
*/
getScrollResponder: function() {
return this.refs[SCROLLVIEW_REF] &&
return this.refs[SCROLLVIEW_REF] &&
this.refs[SCROLLVIEW_REF].getScrollResponder &&
this.refs[SCROLLVIEW_REF].getScrollResponder();
},

scrollTo: function(...args) {
this.refs[SCROLLVIEW_REF] &&
this.refs[SCROLLVIEW_REF] &&
this.refs[SCROLLVIEW_REF].scrollTo &&
this.refs[SCROLLVIEW_REF].scrollTo(...args);
},

Expand Down

0 comments on commit b516976

Please sign in to comment.