You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After playing with the sandbox demos last night, I noticed that the scrollTo function in parallax only ever scrolled to 0 and that it wasn't animated. After digging a little bit I discovered that the value of scroll in the controller was being passed into onChange incorrectly(?) here.
I don't know anything about the new API, but some liberally placed console.logs revealed that in the current version, scroll always equals undefined in onChange.
I have a PR in the works, but wanted to open an issue first for better documentation history.
To Reproduce
Steps to reproduce the behavior:
Attach a click listener to any content nested in Parallax and pass scrollTo in and click.
If Parallax is at scrollTop === 0, nothing will happen, even if the offset passed to the function is positive.
If Parallax is at scrollTop > 0 then Parallax will jump to the top without animating, no matter what offset is passed.
Expected behavior
Parallax should perform an animated scroll to the entered offset.
馃悰 Bug Report
After playing with the sandbox demos last night, I noticed that the
scrollTo
function in parallax only ever scrolled to0
and that it wasn't animated. After digging a little bit I discovered that the value ofscroll
in the controller was being passed intoonChange
incorrectly(?) here.Currently it looks like this:
I got it to work by changing it to this:
I don't know anything about the new API, but some liberally placed
console.log
s revealed that in the current version,scroll
always equalsundefined
inonChange
.I have a PR in the works, but wanted to open an issue first for better documentation history.
To Reproduce
Steps to reproduce the behavior:
scrollTo
in and click.scrollTop === 0
, nothing will happen, even if the offset passed to the function is positive.scrollTop > 0
then Parallax will jump to the top without animating, no matter what offset is passed.Expected behavior
Parallax should perform an animated scroll to the entered offset.
Link to repro (highly encouraged)
sandbox demo: parallax vert
Environment
react-spring
v9.1.2react
v17.0.1The text was updated successfully, but these errors were encountered: