Skip to content

Commit 39c1818

Browse files
linmicFacebook Github Bot
authored and
Facebook Github Bot
committed
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
1 parent 9a8b5d9 commit 39c1818

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Libraries/Components/ScrollView/ScrollView.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,13 @@ const ScrollView = React.createClass({
531531
// On Android wrap the ScrollView with a AndroidSwipeRefreshLayout.
532532
// Since the ScrollView is wrapped add the style props to the
533533
// AndroidSwipeRefreshLayout and use flex: 1 for the ScrollView.
534+
// Note: we should only apply props.style on the wrapper
535+
// however, the ScrollView still needs the baseStyle to be scrollable
536+
534537
return React.cloneElement(
535538
refreshControl,
536539
{style: props.style},
537-
<ScrollViewClass {...props} ref={this._setScrollViewRef}>
540+
<ScrollViewClass {...props} style={baseStyle} ref={this._setScrollViewRef}>
538541
{contentContainer}
539542
</ScrollViewClass>
540543
);

0 commit comments

Comments
 (0)