jscottsmith / react-scroll-parallax

🔮 React hooks and components to create parallax scroll effects for banners, images or any other DOM elements.
https://react-scroll-parallax.damnthat.tv/
MIT License
2.9k stars 158 forks source link

CSS transforms handled by react-scroll-parallax are getting reset. #139

Closed rahuuzz closed 2 years ago

rahuuzz commented 2 years ago

Actual Behavior (bug)

state update is causing parallax to reset to initial after reaching endScroll. An example for demo code can be found here

Expected Behavior

Expecting to prevent resetting the transformations done by react-scroll-parallax after endScroll position.

Steps to Reproduce the Problem

  1. Use the above code sandbox link. (Or create some parallax components and trigger some state update (i did it in onProgressChange))
  2. Scroll till the parallax completes ( scroll position = 460)
  3. See that the transformations are reset (on reaching scroll position 461)

Environment

jscottsmith commented 2 years ago

Thanks for the easy reproduction -- I'll work on a fix this week.

jscottsmith commented 2 years ago

Fix published in v3.0.4. Let me know if there's any other issue.

rahuuzz commented 2 years ago

Tried updating to 3.0.4 still havent solved the issue. preview

jscottsmith commented 2 years ago

ahh, remove the lockfile, the issue was in the dependency and it's probably still using the old version. https://codesandbox.io/s/vigilant-hofstadter-rhthqo?file=/package.json