mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
Updated ListView.scrollTo() API to match ScrollView
Reviewed By: davidaurelio Differential Revision: D2895460 fb-gh-sync-id: 0520df3f2ed6614a08e3fc20a2417c7a8e2ace68
This commit is contained in:
committed by
facebook-github-bot-6
parent
e6cb02d61a
commit
e9f64b2f3f
@@ -227,17 +227,14 @@ var ListView = React.createClass({
|
||||
},
|
||||
|
||||
/**
|
||||
* Provides a handle to the underlying scroll responder to support operations
|
||||
* such as scrollTo.
|
||||
* Provides a handle to the underlying scroll responder.
|
||||
*/
|
||||
getScrollResponder: function() {
|
||||
return this.refs[SCROLLVIEW_REF] &&
|
||||
this.refs[SCROLLVIEW_REF].getScrollResponder &&
|
||||
this.refs[SCROLLVIEW_REF].getScrollResponder();
|
||||
return this.refs[SCROLLVIEW_REF].getScrollResponder();
|
||||
},
|
||||
|
||||
scrollTo: function(destY, destX, animated = true) {
|
||||
this.getScrollResponder().scrollResponderScrollTo(destX || 0, destY || 0, animated);
|
||||
scrollTo: function(...args) {
|
||||
this.refs[SCROLLVIEW_REF].scrollTo(...args);
|
||||
},
|
||||
|
||||
setNativeProps: function(props) {
|
||||
|
||||
Reference in New Issue
Block a user