From 358b34ead7206ff17f2da3862cdc5a1fd44f65fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Hed=C3=A9n?= Date: Fri, 16 Nov 2018 16:27:12 +0100 Subject: [PATCH] Correct height of fixed header to enable pointerEvents --- src/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 79ac5a0..836e3f3 100644 --- a/src/index.js +++ b/src/index.js @@ -296,7 +296,7 @@ export default class ParallaxScroll extends Component { position: 'absolute', top: 0, width, - height, + height: this.isHeaderFixed ? this.props.headerHeight : height, zIndex: 1 }; @@ -306,13 +306,17 @@ export default class ParallaxScroll extends Component { style={{ position: 'absolute', width, - height, + height: this.isHeaderFixed ? this.props.headerHeight : height, opacity, transform: [{ translateY }] }} pointerEvents="box-none" > - {renderParallaxForeground({ width, height, animatedValue: this.scrollY })} + {renderParallaxForeground({ + width, + height: this.isHeaderFixed ? this.props.headerHeight : height, + animatedValue: this.scrollY + })} );