Skip to content

Commit

Permalink
Disable subview clipping when sticky headers are enabled
Browse files Browse the repository at this point in the history
Summary:
Subview clipping still causes issues on Android and would be pretty hard to fix properly, I investigated this a bit and sticky header views are getting removed because it doesn't take transform into consideration. It would also require to recalculate subview clipping on every transform change so I think it is better to just disable subview clipping in when there are sticky headers, especially since we seem to be moving away from subview clipping with things like FlatList.

**Test plan**
Tested that sticky headers work in ListView paging example.

Fixes #14000
Closes #14010

Differential Revision: D5283723

Pulled By: sahrens

fbshipit-source-id: 183b3202765ae09aaae05497694c3f514e969ea1
  • Loading branch information
janicduplessis authored and facebook-github-bot committed Jun 20, 2017
1 parent 75508c1 commit 407ec00
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Libraries/Components/ScrollView/ScrollView.js
Expand Up @@ -676,7 +676,13 @@ const ScrollView = React.createClass({
{...contentSizeChangeProps} {...contentSizeChangeProps}
ref={this._setInnerViewRef} ref={this._setInnerViewRef}
style={contentContainerStyle} style={contentContainerStyle}
removeClippedSubviews={this.props.removeClippedSubviews} removeClippedSubviews={
// Subview clipping causes issues with sticky headers on Android and
// would be hard to fix properly in a performant way.
Platform.OS === 'android' && hasStickyHeaders ?
false :
this.props.removeClippedSubviews
}
collapsable={false}> collapsable={false}>
{children} {children}
</ScrollContentContainerViewClass>; </ScrollContentContainerViewClass>;
Expand Down

0 comments on commit 407ec00

Please sign in to comment.