mirror of
https://github.com/status-im/react-native.git
synced 2025-02-26 16:10:58 +00:00
[Idea: ScrollView] Add getScrollResponder
to ScrollView for composition
Summary: This is a proposal to add `getScrollResponder` to all ScrollView-like components, including ListView. This allows multiple higher-order scroll views to be composed while allowing the owner of the top-level scroll view to call `scrollableView.getScrollResponder().scrollTo(...)` regardless of whether `scrollableView` is a ScrollView, ListView, InvertedScrollView, etc. Closes https://github.com/facebook/react-native/pull/766 Github Author: James Ide <ide@jameside.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
parent
2a7adfb815
commit
6b621a5677
@ -200,6 +200,16 @@ var ScrollView = React.createClass({
|
|||||||
this.refs[SCROLLVIEW].setNativeProps(props);
|
this.refs[SCROLLVIEW].setNativeProps(props);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a reference to the underlying scroll responder, which supports
|
||||||
|
* operations like `scrollTo`. All ScrollView-like components should
|
||||||
|
* implement this method so that they can be composed while providing access
|
||||||
|
* to the underlying scroll responder's methods.
|
||||||
|
*/
|
||||||
|
getScrollResponder: function(): ReactComponent {
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
getInnerViewNode: function(): any {
|
getInnerViewNode: function(): any {
|
||||||
return React.findNodeHandle(this.refs[INNERVIEW]);
|
return React.findNodeHandle(this.refs[INNERVIEW]);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user