Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic playScale in timeline not working #47

Open
navratill opened this issue Oct 19, 2019 · 1 comment
Open

Dynamic playScale in timeline not working #47

navratill opened this issue Oct 19, 2019 · 1 comment

Comments

@navratill
Copy link

navratill commented Oct 19, 2019

Hello, if the dynamic value of playScale property is used in a timeline with the Parallax component when I change the playScale values after the first render (e.g. because of the window resize), it crashes.

Without dynamic values the timeline works fine. Try to put dynamic playScale not on the 0 index of animation, but farther.

<ScrollParallax
    animation={[
      {
            opacity: 1,
            playScale: [1, 1 + contentViewportHeight] // this is fine, contentViewportHeight value is around 0.5 in my test
      },
      {
            opacity: 0,
            playScale: [1 - contentViewportHeight, 1], // because of this value is changing, it crashes
            onStart: () =>
                this._updateState({ imageIndex: 1 }),
            onCompleteBack: () =>
                this._updateState({ imageIndex: 0 })
      }
   ]}
   component={StyledOverlay}
   style={{ opacity: 0 }}
/>
@jljsj33
Copy link
Member

jljsj33 commented Oct 29, 2019

Can you mention the recurrence step and demo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants