Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@ class ParallaxScrollView extends Component {
}) {
const { viewWidth } = this.state
const { scrollY } = this

const translateY = interpolate(scrollY, {
inputRange: [0, stickyHeaderHeight],
outputRange: [-stickyHeaderHeight, 0],
extrapolate: 'clamp'
})

if (renderStickyHeader || renderFixedHeader) {
const p = pivotPoint(parallaxHeaderHeight, stickyHeaderHeight)
return (
Expand All @@ -379,6 +386,7 @@ class ParallaxScrollView extends Component {
styles.stickyHeader,
{
width: viewWidth,
transform: [{ translateY }],
...(stickyHeaderHeight ? { height: stickyHeaderHeight } : null)
}
]}
Expand All @@ -388,6 +396,7 @@ class ParallaxScrollView extends Component {
style={{
backgroundColor: backgroundColor,
height: stickyHeaderHeight,
transform: [{ translateY }],
opacity: interpolate(scrollY, {
inputRange: [0, p],
outputRange: [0, 1],
Expand Down