Skip to content
Open
Changes from all commits
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
13 changes: 7 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ class ParallaxScrollView extends Component {
}

/*
* Expose `ScrollView` API so this component is composable with any component that expects a `ScrollView`.
*/
* Expose `ScrollView` API so this component is composable with any component that expects a `ScrollView`.
*/
getScrollResponder() {
return this.refs[SCROLLVIEW_REF]._component.getScrollResponder()
}
Expand All @@ -173,8 +173,8 @@ class ParallaxScrollView extends Component {
}

/*
* Private helpers
*/
* Private helpers
*/

_onScroll(e) {
const {
Expand Down Expand Up @@ -252,7 +252,7 @@ class ParallaxScrollView extends Component {
{
translateY: interpolate(scrollY, {
inputRange: [0, p],
outputRange: [0, -(p / backgroundScrollSpeed)],
outputRange: [0, backgroundScrollSpeed === 0 ? 0 : -(p / backgroundScrollSpeed)],
extrapolateRight: 'extend',
extrapolateLeft: 'clamp'
})
Expand Down Expand Up @@ -371,6 +371,7 @@ class ParallaxScrollView extends Component {
}) {
const { viewWidth } = this.state
const { scrollY } = this
const { backgroundScrollSpeed } = this.props;
if (renderStickyHeader || renderFixedHeader) {
const p = pivotPoint(parallaxHeaderHeight, stickyHeaderHeight)
return (
Expand Down Expand Up @@ -401,7 +402,7 @@ class ParallaxScrollView extends Component {
{
translateY: interpolate(scrollY, {
inputRange: [0, p],
outputRange: [stickyHeaderHeight, 0],
outputRange: [backgroundScrollSpeed === 0 ? 0 : stickyHeaderHeight, 0],
extrapolate: 'clamp'
})
}
Expand Down