From 407ec0023fb3d292bcb2583c9a1bb6791f2e046d Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Tue, 20 Jun 2017 09:32:24 -0700 Subject: [PATCH] Disable subview clipping when sticky headers are enabled 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 https://github.com/facebook/react-native/pull/14010 Differential Revision: D5283723 Pulled By: sahrens fbshipit-source-id: 183b3202765ae09aaae05497694c3f514e969ea1 --- Libraries/Components/ScrollView/ScrollView.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index cf75b0422..463f77b6f 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -676,7 +676,13 @@ const ScrollView = React.createClass({ {...contentSizeChangeProps} ref={this._setInnerViewRef} 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}> {children} ;