mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Fix scrollTo when using RefreshControl on Android
Summary: The issue is that the ScrollResponder mixin assumes that the native scrollable node is the top level element and gets it using `React.findNodeHandle(this)` but since Android wraps the native `ScrollView` component with the `RefreshControl`, it finds the native `RefreshControl` node instead and the scroll command gets ignored because it doesn't exists. This adds a hook to ScrollResponder mixin to allow specifying what is the native scrollable node. The bug can be reproduced using this https://gist.github.com/janicduplessis/871c0b6d3ad0acaacba9 in UIExplorer. Fixes #5725 Closes https://github.com/facebook/react-native/pull/5736 Reviewed By: svcscm Differential Revision: D2896125 Pulled By: nicklockwood fb-gh-sync-id: 0a00a20551421982c5bc519c542774877ba15c9b
This commit is contained in:
committed by
facebook-github-bot-5
parent
0fa54d5a22
commit
db74e713fe
@@ -355,6 +355,10 @@ var ScrollView = React.createClass({
|
||||
return this;
|
||||
},
|
||||
|
||||
getScrollableNode: function(): any {
|
||||
return React.findNodeHandle(this.refs[SCROLLVIEW]);
|
||||
},
|
||||
|
||||
getInnerViewNode: function(): any {
|
||||
return React.findNodeHandle(this.refs[INNERVIEW]);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user