From 260ca6ddc483076ef509d1f9719329df507dedaf Mon Sep 17 00:00:00 2001 From: Nickolay Ilchenko Date: Thu, 21 Jun 2018 01:11:06 +0300 Subject: [PATCH] Events are not passed through to the foreground view if STICKY_HEADER_HEIGHT overlaps #25 --- src/index.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/index.js b/src/index.js index 8787b6f..117fecd 100644 --- a/src/index.js +++ b/src/index.js @@ -69,7 +69,7 @@ class ParallaxScrollView extends Component { animatedEvent = Animated.event( [{ nativeEvent: { contentOffset: { y: this.scrollY } } }], - { useNativeDriver: true } +// { useNativeDriver: true } ) render() { @@ -140,7 +140,7 @@ class ParallaxScrollView extends Component { // Using Native Driver greatly optimizes performance onScroll: Animated.event( [{ nativeEvent: { contentOffset: { y: this.scrollY } } }], - { useNativeDriver: true, listener: this._onScroll.bind(this) } + { listener: this._onScroll.bind(this) } ) // onScroll: this._onScroll.bind(this) }, @@ -372,22 +372,19 @@ class ParallaxScrollView extends Component { const { viewWidth } = this.state const { scrollY } = this if (renderStickyHeader || renderFixedHeader) { - const p = pivotPoint(parallaxHeaderHeight, stickyHeaderHeight) + const p = pivotPoint(parallaxHeaderHeight, stickyHeaderHeight); + let height = interpolate(scrollY, { + inputRange: [0, stickyHeaderHeight], + outputRange: [0, stickyHeaderHeight], + extrapolate: 'clamp' + }); return ( - + {renderStickyHeader ?