Permalink
Browse files

Fix redundant styles on RefreshControl for Android

Summary:
Fixed a bug that RefreshControl wrongly apply redundant styles on Android, this solves #10742
Closes #10899

Differential Revision: D4176670

fbshipit-source-id: 357bfd726a39fe8e79d4d70ddfdfd1d39034620e
  • Loading branch information...
1 parent 9a8b5d9 commit 39c18186e1a5bcc4cc5c5f42a9193c1a8b86cd30 @linmic linmic committed with Facebook Github Bot Nov 15, 2016
Showing with 4 additions and 1 deletion.
  1. +4 −1 Libraries/Components/ScrollView/ScrollView.js
@@ -531,10 +531,13 @@ const ScrollView = React.createClass({
// On Android wrap the ScrollView with a AndroidSwipeRefreshLayout.
// Since the ScrollView is wrapped add the style props to the
// AndroidSwipeRefreshLayout and use flex: 1 for the ScrollView.
+ // Note: we should only apply props.style on the wrapper
+ // however, the ScrollView still needs the baseStyle to be scrollable
+
return React.cloneElement(
refreshControl,
{style: props.style},
- <ScrollViewClass {...props} ref={this._setScrollViewRef}>
+ <ScrollViewClass {...props} style={baseStyle} ref={this._setScrollViewRef}>
{contentContainer}
</ScrollViewClass>
);

0 comments on commit 39c1818

Please sign in to comment.