From b51697645792b35214615552dbb66e6b262ec477 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Fri, 19 Feb 2016 05:02:27 -0800 Subject: [PATCH] Support custom ScrollView implementations in ListView Summary: See https://github.com/facebook/react-native/commit/e9f64b2f3f3ff1e71e8592e4522ba1cf25c3c5b0#commitcomment-16166567 Reviewed By: tadeuzagallo Differential Revision: D2953787 fb-gh-sync-id: b8978b3fa6ae9e848be918cc707335a06ea56cf6 shipit-source-id: b8978b3fa6ae9e848be918cc707335a06ea56cf6 --- Libraries/CustomComponents/ListView/ListView.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index c10717b5a..b4931fedb 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -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); },