From 2bfa20efe1f29ba696ef2e1d23eeb8cfac818aef Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Mon, 5 Dec 2016 21:51:03 -0500 Subject: [PATCH] Fix --- .../Components/ScrollView/ScrollViewStickyHeader.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index 1f07d657f72c35..24596e2e99a2cf 100644 --- a/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -13,8 +13,11 @@ const Animated = require('Animated'); const React = require('React'); +const UIManager = require('UIManager'); const StyleSheet = require('StyleSheet'); +const findNodeHandle = require('findNodeHandle'); + type Props = { children?: React.Element<*>, scrollAnimatedValue: Animated.Value, @@ -47,11 +50,14 @@ class ScrollViewStickyHeader extends React.Component { let translateY; if (measured) { - const inputRange = [-1, layoutY, layoutY + 1]; - const outputRange: Array = [0, 0, 1]; + const inputRange = [-1, layoutY]; + const outputRange: Array = [0, 0]; if (nextHeaderLayoutY != null) { inputRange.push(nextHeaderLayoutY, nextHeaderLayoutY + 1); - outputRange.push(nextHeaderLayoutY, nextHeaderLayoutY); + outputRange.push(nextHeaderLayoutY - layoutY, nextHeaderLayoutY - layoutY); + } else { + inputRange.push(layoutY + 1); + outputRange.push(1); } translateY = this.props.scrollAnimatedValue.interpolate({ inputRange, @@ -65,6 +71,7 @@ class ScrollViewStickyHeader extends React.Component { return ( {React.cloneElement(child, {