From dd479a93772c3a52561fc32ee84b25ce822a30fa Mon Sep 17 00:00:00 2001 From: Danny Cochran Date: Fri, 23 Mar 2018 14:45:59 -0700 Subject: [PATCH] Pass invertStickyHeaders to ScrollView Summary: invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in https://github.com/facebook/react-native/issues/18471 Fixes #18471 Pass "invertStickyHeaders: false" to a SectionList (or FlatList), and expect that your sticky headers stick to the bottom of the ScrollView, instead of the top. none [ANDROID] [BUGFIX] [SectionList] - invertStickyHeaders can now be set from SectionList or FlatList. Closes https://github.com/facebook/react-native/pull/18524 Differential Revision: D7386163 Pulled By: hramos fbshipit-source-id: 3b66dfca280e657303f69f98c5a8bc0df033f9f7 --- Libraries/Lists/VirtualizedList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 4c7a83b19d77fb..928050f7682fa4 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -893,7 +893,9 @@ class VirtualizedList extends React.PureComponent { onScrollEndDrag: this._onScrollEndDrag, onMomentumScrollEnd: this._onMomentumScrollEnd, scrollEventThrottle: this.props.scrollEventThrottle, // TODO: Android support - invertStickyHeaders: this.props.inverted, + invertStickyHeaders: this.props.invertStickyHeaders !== undefined + ? this.props.invertStickyHeaders + : this.props.inverted, stickyHeaderIndices, }; if (inversionStyle) {